First Forums Template Files Special Template Files

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1577
    Crumina team
    Keymaster

    WordPress features two core page views of web pages in a WordPress site. The single post view is used when the web pages displays a single post.

    #1578
    Crumina team
    Keymaster

    The multi-post view lists multiple posts or post summaries, and applies to category archives, date archives, author archives, and (usually) the “normal” view of your blog’s home page.

    #1579
    Crumina team
    Keymaster

    You can use the index.php template file to generate all of these types of pages or rely on WordPress’ template hierarchy to choose different template files depending on the situation.

    The WordPress Template Hierarchy answers the following question:

    #1580
    Crumina team
    Keymaster

    WordPress automatically recognizes template files with certain standard names and uses them for certain types of web pages. For example, when a user clicks on the title of a blog post, WordPress knows that they want to view just that article on its own web page. The WordPress template hierarchy will use the single.php template file rather than index.php to generate the page — if your Theme has a single.php file.

    #1581
    Crumina team
    Keymaster

    Similarly, if the user clicks on a link for a particular category, WordPress will use the category.php template if it exists; if it doesn’t, it looks for archive.php, and if that template is also missing, WordPress will go ahead and use the main index.php template. You can even make special template files for specific categories (see Category Templates for more information).

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.