Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Daniel Proczko

    (@diggler)

    I found the template chooser function, but when inspecting the shortcode function, the main “kbe_knowldegabse.php” file is hard coded and isn’t pulled by the chooser function. Is there a way to pull the customized file?

    This line of the funciton below is a hard coded line that doesn’t allow customized files to be loaded:

    $return_string = require dirname( __FILE__ ) . ‘/../template/kbe_knowledgebase.php’;

    This line is saying: Grab the directory of this file, go up one level, then into “template” and grab the file. WIthout any template chooser references or “IF” statements, customized files are irrelevant right now.

    Is this something you can update?

    function kbe_shortcode( $atts, $content = null ) {
    if ( !is_admin() ) {
    $return_string = require dirname( __FILE__ ) . ‘/../template/kbe_knowledgebase.php’;
    wp_reset_query();
    return $return_string;
    }
    }
    add_shortcode( ‘kbe_knowledgebase’, ‘kbe_shortcode’ );

    Blake

    (@alexanderblake)

    Oh man, this is something I can’t help with, but here’s what I did.

    I took the template folder and renamed it wp-knowledgebase and put it in my theme folder. That gave me the files to edit from the appearance editor in WordPress (in my theme).

    I just added the shortcode to the KB page directly, and it all came together. I had to add a bunch of CSS to my theme panel to get the KB to look more like how I wanted it, but that’s all I did.

    I wish I could help more.

    Blake

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin not loading customized template files from theme folder’ is closed to new replies.