Reputation: 522
My understanding from reading the WP template hierachy was that when I set my a page as my posts page in settings > reading settings
that Wordpress should use archive.php. Instead it uses index.php
.
Obviously I could just put my code in index.php
and my site will work. But it doesn't seem like best practice, and I can't find any documentation of best (or good) practice.
Why doesn't Wordpress use archive.php
in this circumstance?
And would using index.php
as my posts page have unintended consequences?
Note: I've been using the _s theme as a base, but I've had the same problem with no theme base or parent.
Upvotes: 6
Views: 6028
Reputation: 612
I was in a similar situation for last 2/3 hours and by changing "Permalink Settings" to "post Name" in wordpress dashboard solved the problem for me.
Upvotes: 2
Reputation: 371
you want to use home.php instead of archive.php as it is blog posts index page (set in WordPress Settings -> Reading). It is also in hierarchy on the third position from bottom.
Upvotes: 8