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:
- Blog page with pagination: meusite.com.br/blog
- Internal posts: meusite.com.br/blog/titulodopost
Yes I have already marked the following options:
Has Archive = True
Hierarchical = True
the
slug
of the CPT is blog, and theslug
page is also blog?– Caio Felipe Pereira
Exactly, I’m sure it’s not working the way I want it to, but there must be a way to solve.
– Sérgio Machado
try disabling permalinks and testing pagination.
– Caio Felipe Pereira
Disabling the permalink works, only then the url does not look like I want
– Sérgio Machado
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– Caio Felipe Pereira
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 ?
– Sérgio Machado
Let’s go continue this discussion in chat.
– Caio Felipe Pereira