Site logo

[Support request] Problem with pagination on category page

Home Forums Support [Support request] Problem with pagination on category page

Home Forums Support Problem with pagination on category page

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #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.

    #1874309
    David
    Staff
    Customer Support

    Hi 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.

    #1874336
    Pawel

    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.

    #1874444
    David
    Staff
    Customer Support

    Do 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.

    #1874459
    Pawel

    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?

    #1874460
    David
    Staff
    Customer Support

    First 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.

    #1874476
    Pawel

    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

    #1874491
    David
    Staff
    Customer Support

    Have 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.

    #1874494
    Pawel

    No, I followed your advice, just clicked save.

    #1874744
    David
    Staff
    Customer Support

    Where do you have a link to your Podcast?
    As the link needs to be: /category/podcast/

    #1874804
    Pawel

    I don’t have it, but when I type it manually to the web browser it works.

    #1874812
    David
    Staff
    Customer Support

    Then 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/

    #1874822
    Pawel

    I understand David, thanks a lot.

    #1875521
    David
    Staff
    Customer Support

    You’re welcome

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.