WordPress.org

Ready to get started?Download WordPress

Forums

index.php and an identical template (6 posts)

  1. Roger
    Member
    Posted 1 year ago #

    I have a mystery. My index.php file displays the usual header, posts loop in content, sidebar and footer. It works fine when I navigate to a page that has no template file.

    When I copy the contents of index.php and past them into a template file (page-shows.php) and then navigate to the page "shows", I do not see any posts. Everything else is there, just no posts.

    There is absolutely no difference between these two files except their names.

    What am I missing? What is WordPress doing when the template defaults to the index.php file that it is not doing when it finds a template?

  2. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Do both files have the same template names?

  3. Roger
    Member
    Posted 1 year ago #

    Sorry, I overstated. The template file has the comment declaring it a template for shows. The index file has not template declaration.

  4. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Do you have access to your apache error logs?

  5. Roger
    Member
    Posted 1 year ago #

    yes - I'm running on my localhost.

  6. Roger
    Member
    Posted 1 year ago #

    I have no log entry in the error log for today.

Topic Closed

This topic has been closed to new replies.

About this Topic