Forums

Which of the PHP files display content? (4 posts)

  1. Anonymous
    Unregistered
    Posted 3 years ago #

    I'm trying to go through all the PHP files that display posts to make certain things are consistent every time a post or several posts show up on those pages.

    Example: I want to Tags to appear under every post, whether that post is accessed through the index page, the permalink, the search, the archives, the calendar, the tag links, etc.

    So I found this bit of code:
    <?php the_tags('Tags: ', ', ', '
    '); ?>

    ..and then tried to figure out where I was supposed to PUT it. After looking through the files, I found that the home page = index.php, permalink page = single.php, search page = search.php, and whatnot. I put the code in and it worked for those pages.

    Which PHP files account for pages accessed through the calendar, the tags, the categories, and whatever else I may be missing? I can't figure those out.

    I hope that was clear enough; if not, I can try to expound upon it.

  2. Chris_K
    Member
    Posted 3 years ago #

    Ah, you might like Template_Hierarchy to start with. It'll show you what theme files are used for various purposes.

  3. Anonymous
    Unregistered
    Posted 3 years ago #

    HandySolo: It seems like WordPress didn't come with some of the files listed under the Template Hierarchy, such as category.php. Do I have to create it from scratch? Or is there some template files I can download somewhere?

    From what I'm reading seems that the hierarchy should be sourcing the index page if category.php is missing, but it's not retrieving the "Tag" tag... am I doing something wrong?

  4. Chris_K
    Member
    Posted 3 years ago #

    It seems like WordPress didn't come with some of the files listed under the Template Hierarchy, such as category.php.

    Files created/used are completely up to your theme's developer. As you noticed from the link I gave, there's a hierarchy (or "fall through") to determine what file is actually used for a given purpose.

    From what I'm reading seems that the hierarchy should be sourcing the index page if category.php is missing, but it's not retrieving the "Tag" tag... am I doing something wrong?

    I'm afraid I don't understand the question. Do you have an example or links that would help illustrate?

Topic Closed

This topic has been closed to new replies.

About this Topic