0
votes

The site has a few custom post types with Archive page enabled. So I get the following URL structure

http://example.com/offices/   This is the archive page for office
http://example.com/office/san-fran   This is the single page for office
http://example.com/office/new-york   This is the single page for office

and

http://example.com/members/   This is the archive page for member
http://example.com/member/john-smith   This is the single page for member

Everything works great with CPT.

BUT I'm trying to change the base path for the built-in post_type "post". I first updated the permalink settings to

/blog/%year%/%monthnum%/%day%/%postname%/

which takes care of

http://example.com/blog/2017/10/post
http://example.com/blog/2017/10/
http://example.com/blog/2017/

but

http://example.com/blog/

does not work. After some Googling, I created a blank page called "Blog" and set it as my "Posts page" in Setting -> Reading. That kinda works BUT wordpress doesn't seem to treat it as an archive page.

When looking at the post_classes, office would have something like this

class="archive post-type-archive post-type-archive-office logged-in tribe-no-js sidebar-primary app-data index-data archive-data archive-office-data"

and blog would be like this

class="blog logged-in tribe-no-js app-data index-data home-data"

I thought about creating another CPT for blog but I'd much prefer to use the build-in post. Is there a way to create a real archive page for posts?

1
Does your theme have an archive.php file? If you haven't seen this, I think you'll find it useful: developer.wordpress.org/files/2014/10/wp-hierarchy.png - admcfajn

1 Answers

0
votes

If you don't have archive.php -template and/or your CPT's are typed as pages instead of posts, that might cause this behavior.