Exclude function from homepage only?

Based on your pastes, i think what you’re going for is.. function cp_do_pagination() { if( is_home() || is_singular() /* || is_front_page() */ ) return; global $post; // <– do you need this for something in particular? if( !function_exists(‘appthemes_pagination’) ) return; appthemes_pagination(); } The is_singular() function covers is_page(), is_single() and is_attachment(), so no need for the … Read more

Organize template parts and page templates in folders in regards of template hierarchy

Page templates are special case and since WP 3.4 can be put in subfolder natively. Other than that WP mostly expects flat file structure for templates. While template hierarchy is easily adjusted (see dynamic filter in get_query_template(), pretty much only thing needed)… From personal experience – overly extensive and nested directory structure for templates makes … Read more

Is “get_template_part” hierarchy possible?

Yes, what you describe is already built in to the get_template_part() function: <?php get_template_part( $slug, $name ); ?> Where “masthead” is the general template slug in your example, and “custom” is the more specialized version. You’ll have to name your parts slug-name.php (so, masthead-custom.php, rather than custom-masthead.php). Note that you can also use the value … Read more

Including template pages within another template?

The function get_page() has been deprecated, don’t use it anymore, use get_post() instead. get_page_by_title() returns an object by default, you can change this by altering the $output parameter, which you can use like you did. Although get_post() can take an object as $id parameter I personally prefer inputing the ID, but that actually shouldn’t matter. … Read more