WordPress.org

Support

Support » Themes and Templates » [Resolved] Confusion about Template Hierarchy, need help…

[Resolved] Confusion about Template Hierarchy, need help…

  • Heya – I’m confused about the Template Hierarchy and I’m not having any luck reviewing the codex to resolve the matter.

    Basically, I understand that single.php displays a unique layout for pages that are showing a SINGLE post. I understand if that isn’t there than it will use index.php. I also understand that in the Settings -> Reading section I need to select a page to be my “Posts Page” where all of my articles will display.

    Where I’m confused is after I have defined my “Posts Page”, it’s still utilizing index.php, when I need it to access a different template (but I’m not sure which one) SO I CAN DISPLAY a few RECENT POSTS AND also the CATEGORIES. Help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Samuel B
    Participant

    @samboll

    To have a “Posts” page, you have to have a static home page set
    then you would create an empty page titled “Posts”
    save it and then assign it as your posts page

    Hi Samboll – I actually already have my Static Page set to Home (/), and I also have my Posts Page set to Blog (/blog). Additionally, I have an “Archives Index” page (which I created while following Template Hierarchy instructions) that is utilizing my “Archives” (archives.php) template.

    But I still only get categories on my Archives Index (/archives-index – archives.php) page and articles without the categories on my Blog (/blog – index.php) page.

    Okay, so… I was told I need to create a page -> make that page the “Posts Page” (by selecting Settings -> Reading -> Posts Page -> “Example”). But I couldn’t get it to work properly (though I understand I’m simply overlooking something, no one was able to tell me what though.

    So I duplicated archive.php and imported it into my theme directory – making the applicable revisions – and discovered that this page lists all of my posts (or whatever number you set in Settings -> Reading -> Blog Pages Show At Most…) with their titles (linked to the single post – which utilizes single.php for those of you who haven’t referenced, or don’t understand, the WordPress Codex.), tags, comments, etc…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Confusion about Template Hierarchy, need help…’ is closed to new replies.