Most efficient way to have 1 template for parent, 1 template for child categories?
Most efficient way to have 1 template for parent, 1 template for child categories?
Most efficient way to have 1 template for parent, 1 template for child categories?
I think you are searching for custom page-template. Make yourself a page-customarchive.php and name her in the top of the file.: <?php /* Template Name: customarchive */ //Your custom query for this post_type Put her in your theme directory Then make a new Page in WordPress and pick from the right side the template you … Read more
Are you sure that you have deleted completely all previous pages with the slug ‘news’ ? When you click on Trash, the page/post is only placed into the Trash folder, not deleted. You must then empty the trash folder to completely delete the page. If the old page remains in the trash folder and you … Read more
This turned out to be far easier than I had feared, using the template_include filter – /** * Override the standard WordPress template with the ‘please login’ template if the current user is not logged in */ add_filter(‘template_include’, ‘portfolio_page_template’, 99); function portfolio_page_template($template){ /** List the pages that are authorised for non-logged in users */ $authorised_pages … Read more
Page Templates Used in Custom Post Type
How to stop the search results from loading the wrong template?
you can name the file in this way: taxonomy-{taxonomy}.php as described in this page, there you can create a loop adn WP will only select the elements of the given taxonomy.
There is no is_home_page() function in Core. You have either is_home() or is_front_page() and you have to be careful about the two. They can be squirrelly. I don’t know which of the two functions you need but sorting that out should solve the problem, or use (is_home() || is_front_page()) perhaps.
Custom Homepage As Single Page or Custom Post Type?
Use different file includes for single.php