0

I am trying to create a paged mosaic list of posts for each post type (post, custom post types), but I'm having trouble to get the default 'post' post type to work.

So in the frontpage, I'm using get_post_type_archive_link() to return the link post type to go to the archive post type, and it works fine for every custom post type.

Example: for the custom post type 'events', get_post_type_archive_link('events') returns the 'http.//www.site.org/events/' that is what is expected. But, for the 'post' post type, get_post_type_archive_link('post') returns the root of the site 'http.//www.site.org/'. Also I have noticed that the link 'http.//www.site.org/post/' and 'http.//www.site.org/page/' does not works this way.

So, is it possible to list the 'post' post type in dedicated template like others custom post types (ex. 'http.//www.site.org/post/'? And if so, how?

Thanks!

0

In the Permalink settings page, you can add your custom permalink structure to make it like you want.

By default, the value is /%postname%/ Check Custom structure and correct to /post/%postname%/

Save (of course !), it will flush the rewrite rules to get it work correctly.

  • I have already tried that and it, and the problem is the same in my case (also tried set permalinks to plain).Also it was not the solution necessary because it put '/post' in every link. I think the solution is more connected to change the slug or url rewrite rules, but I am stuck in this problem. – user38561 Sep 27 '16 at 14:37
  • So, what about create a special page with the permalink slug "posts" and make your special loop to get what you want ? have a look to the WordPress function : add_rewrite_endpoint, that's the better and cleaner way to do it. – Benoti Sep 27 '16 at 15:03
  • I has trying to use all the standards and recommendation from wordpress, and this should be a simple thing, at least I thought, but didn't find any default function for this…well, I can try that workaround and make a special page like that. Also the add_rewrite_endpoint can help. Thanks for the help! – user38561 Sep 27 '16 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.