if(!function_exists(‘get_course_data’)) {

/**
 * Get course data from database.
 *
 * @access public
 * @param 
 * @return array
 * @since 1.0.0
*/
function get_course_data( $paged, $courses_per_page ){

    global $wpdb;
    $table_name = $wpdb->prefix . 'course_detail';

    $offset = ( $paged - 1 ) * $courses_per_page;
    $query = $wpdb->prepare( "SELECT * FROM $table_name LIMIT %d, %d", $offset, $courses_per_page );

    $results = $wpdb->get_results($query);

    return $results;

}

}

if(!function_exists(‘get_course_count’)) {

/**
 * Get course count.
 *
 * @access public
 * @param 
 * @return string
 * @since 1.0.0
*/
function get_course_count(){

    global $wpdb;
    $table_name = $wpdb->prefix . 'course_detail';
    $count_query = "SELECT COUNT(*) FROM $table_name";
    return $wpdb->get_var($count_query);

}

}

if(!function_exists(‘get_course_page_slug’)) {

/**
 * Get course page slug.
 *
 * @access public
 * @param
 * @return string
 * @since 1.0.0
*/
function get_course_page_slug(){

    $page_id = get_option('add_course_page_id');
    if( $page_id ){
        $page_slug = get_post_field( 'post_name', $page_id );
        return $page_slug;
    }
}

}

if(!function_exists(‘get_course_by_ID’)) {

/**
 * Get course by id.
 *
 * @access public
 * @param int
 * @return array
 * @since 1.0.0
*/
function get_course_by_ID($course_id){

    global $wpdb;
    $course = $wpdb->get_row( $wpdb->prepare("SELECT * FROM {$wpdb->prefix}course_detail WHERE id = %d", $course_id) );
    return $course;
}

}

case studies

See More Case Studies

Test1

public function __construct() {add_shortcode(‘course_list’, array($this, ‘display_course_list’));} $output .= ”; } function get_course_data( $paged, $courses_per_page ){ global $wpdb; $table_name = $wpdb->prefix . ‘course_detail’; $offset = (

Learn more
Contact us

Partner with Us for Comprehensive IT

We’re happy to answer any questions you may have and help you determine which of our services best fit your needs.

Your benefits:
What happens next?
1

We Schedule a call at your convenience 

2

We do a discovery and consulting meting 

3

We prepare a proposal 

Schedule a Free Consultation