Page-blog.php pagination in Wordpress

Asked

Viewed 222 times

0

I’m creating a theme Wordpress and created a page called Blog that is using the file page-blog.php as a model and the Slug of the page is also blog, where the same will list all the posts of a CPT called blog, where the same me configured Slug for blog. But for some reason I can’t make the paging work and also the loading of the single-blog.

When paging works internal stop, and vice versa, to solve this I had to change the CPT Lug for posts.

However I wanted the url to look like this:

Yes I have already marked the following options:

  • Has Archive = True

  • Hierarchical = True

  • the slug of the CPT is blog, and the slug page is also blog?

  • Exactly, I’m sure it’s not working the way I want it to, but there must be a way to solve.

  • try disabling permalinks and testing pagination.

  • Disabling the permalink works, only then the url does not look like I want

  • Exactly. With permalinks enabled, when you have /blog/post, WP gets lost because /blog can be both your page and your post type. Do you have to necessarily use a CPT? Does the WP standard not meet? With that, that problem disappears

  • Not necessarily, it could be the default post, but in the case I would use Category.php there as I would for instead of Category/post, stay blog/post ?

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.