Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

template-hierarchy

Displaying a custom post type and an archive page

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

Categories template-hierarchy Tags template-hierarchy

Needed to change slug to access page

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

Categories url-rewriting Tags slug, template-hierarchy, url-rewriting

Show a custom template, no matter the page being viewed, if the user is not logged in

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

Categories templates Tags login, template-hierarchy, templates

Page Templates Used in Custom Post Type

Page Templates Used in Custom Post Type

Categories templates Tags archive-template, page-template, single, template-hierarchy, templates

How to stop the search results from loading the wrong template?

How to stop the search results from loading the wrong template?

Categories search Tags search, template-hierarchy

Creating a Taxonomy Page [duplicate]

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.

Categories custom-taxonomy Tags archives, custom-taxonomy, taxonomy, template-hierarchy

Ajax specific template not loading in replacement of index.php

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.

Categories plugins Tags ajax, json, plugins, template-hierarchy, themes

Custom Homepage As Single Page or Custom Post Type?

Custom Homepage As Single Page or Custom Post Type?

Categories custom-post-types Tags custom-post-types, homepage, page-template, template-hierarchy, templates

Use different file includes for single.php

Use different file includes for single.php

Categories categories Tags categories, template-hierarchy, templates

How to add dynamic content to posts page, archive, taxonomies, search, author, etc?

In your page template your code could be something as simple as this: do_action(‘archive_page_html’); The thing is, if you are building a plugin, having your users modify their theme templates to put this in may or may not be so desirable, but since different themes have different templates and you are writing a plugin, it … Read more

Categories plugins Tags plugins, template-hierarchy, templates
Older posts
Newer posts
← Previous Page1 … Page3 Page4 Page5 … Page25 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress