Override author-course.php

Home Forums Legacy Support Support queries Child Themes Override author-course.php

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11898
    miguelprado2
    Spectator
    How Override author-course.php in child theme?   Thanks
    #12020
    Anshuman Sahu
    Keymaster
    Add this code in your child theme functions.php file and then you are ready to go to override the author-course.php file . add_filter( 'template_include','wplms_check_instructing_courses_endpoint12',99,2); function wplms_check_instructing_courses_endpoint12($template){     if(!is_author())       return $template;     global $wp_query;     $instructing_courses=apply_filters('wplms_instructing_courses_endpoint','instructing-courses');     if ( !isset( $wp_query->query_vars[$instructing_courses] ) ){        $wp_query->set( 'post_type',  array('post') );        return get_stylesheet_directory().'/author.php';     }else{       $wp_query->set( 'post_type',  array('course') );       return get_stylesheet_directory().'/author-course.php';     }     }
    #12887
    miguelprado2
    Spectator
    Thanks, it's work.
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Override author-course.php’ is closed to new replies.