Creating Custom Templates

In case you need to create your own templates for Helpie’s Articles, you can register a customer template using this snippet.

 

function set_custom_helpie_template($template){
// For single page
if ( is_singular('pauple_helpie') ) {
$template = get_stylesheet_directory().'/single-pauple_helpie.php';
break;
}

// For category page
if ( is_tax( ‘helpdesk_category’) ) {
$template = get_stylesheet_directory().’/tax-pauple.php’;
}

// For the main archive page of Helpdesk Articles
if( is_post_type_archive(‘pauple_helpie’){
$template = get_stylesheet_directory().’/archive-pauple.php’;
}
return $template;
}
add_filter(‘template_include’,’set_custom_helpie_template’);

How did you like this article?0100

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>