- This topic has 13 replies, 2 voices, and was last updated 4 years, 2 months ago by
David.
-
AuthorPosts
-
July 28, 2021 at 4:43 am #1874217
Pawel
Hello team,
I have a problem with pagination on one of my category pages.
My site has only two categories: blog and podcast.
The blog seems to work well, I noticed there is a specific page created for it with the URL /blog/. When I visit this page it displays the posts correctly and the pagination at the bottom of the page works well.
The problem is with ‘podcast’ category. This category does not have a special page created for it. I wanted to create one but I cannot use the URL /podcast/ for it as it is used already (I think there is a conflict between page URL and category URL).
So, when I visit the /podcast/, I can see the posts but when using the pagination, there is a 404 error.
I have noticed one more thing. When the address is /category/podcast/page/2/ the page is displayed correctly.
I hope this is not too confusing. Any thoughts on how to make the pagination work?
Thank you.
July 28, 2021 at 5:47 am #1874309David
StaffCustomer SupportHi there,
if you have a static page, post or image attachment that has the same slug as the category then you will run into conflicts.
If thats the case you should either edit the ‘page’ or the ‘category’ so they have a different slug.If theres still an issue after doing that, then link me to the site so i can take a look.
July 28, 2021 at 6:00 am #1874336Pawel
Thanks, David. Just a few questions before I start breaking the website 😉
Do categories need to have pages?
If so, what URL will be displayed, the one from a category or page?
When I create a page for a category, how to set it to display posts from this category only?
Thanks in advance.
July 28, 2021 at 7:08 am #1874444David
StaffCustomer SupportDo categories need to have pages?
No. And you shouldn’t add them either. The theme will use the archive template for their display. Likewise you should not edit the Blog page that you have selected in Settings > Reading > Latest Posts display.If so, what URL will be displayed, the one from a category or page?
It uses the Category Term Slug which you can see in the Posts > Category editor. This slug is what you must ensure is not duplicated elsewhere.When I create a page for a category, how to set it to display posts from this category only?
As above, you should not create pages for them. Although you can create a static page and use a plugin like WP Show Posts to show the category term list, you will then need to do a lot of hoop jumping to manage the sites URL hierarchy.If you need to add other content to a category archive then use the Block Element to hook in what you require.
July 28, 2021 at 7:25 am #1874459Pawel
Thank you David, I appreciate your help.
I think everything is set up correctly, I do not have a page for the podcast category, the page is displayed correctly but the pagination is not working (404 error).
Here is this page https://www.smartpolak.co.uk/podcast/
Any ideas on how to fix it?
July 28, 2021 at 7:29 am #1874460David
StaffCustomer SupportFirst thing to try is to rebuild the permalinks.
Go to Dashboard > Settings > Permalinks and just click the Save Changes button ( no need to make any changes ). Then clear any plugin/browser caches.July 28, 2021 at 7:34 am #1874476Pawel
unfortunately, it doesn’t work
it looks like the pagination “doesn’t know” that there is no word category in the permalink, so
/podcast/page/2/ -> this shows 404 but
/category/podcast/page/2/ -> is correct
July 28, 2021 at 7:43 am #1874491David
StaffCustomer SupportHave you made any changes to the Permalink structure ?
If you haven’t then aside from an SEO Plugin doing something weird it will most likely be because there is another Post, Page or Image attachment with the same slug.
July 28, 2021 at 7:44 am #1874494Pawel
No, I followed your advice, just clicked save.
July 28, 2021 at 8:18 am #1874744David
StaffCustomer SupportWhere do you have a link to your Podcast?
As the link needs to be:/category/podcast/July 28, 2021 at 9:00 am #1874804Pawel
I don’t have it, but when I type it manually to the web browser it works.
July 28, 2021 at 9:09 am #1874812David
StaffCustomer SupportThen thats the link you need to be sharing or using. If for example you add a menu link to that archive it must be:
/category/podcast/July 28, 2021 at 9:21 am #1874822Pawel
I understand David, thanks a lot.
July 29, 2021 at 3:38 am #1875521David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.