Site logo

[Support request] Display page instead of archive

Home Forums Support [Support request] Display page instead of archive

Home Forums Support Display page instead of archive

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2157312
    Lee

    I want to create topic groups for my blog posts; for eg:

    – Food
    – Energy
    – Skills

    The url for these posts would be domain.com/food/

    I have created a page with the permalink ‘food’.

    I also have a blog category ‘food’.

    I have changed permalink structure to be domain.com/category/post

    I want to display my page instead of the category archive when user types in domain.com/food/

    I have tried the fix here: https://stackoverflow.com/questions/64414771/set-custom-pages-instead-of-category-archive-pages

    And it works at replacing archive with page but the styling on the page is messed up and the page no longer pulls in posts via the [wp_show_posts id=”xxxx”] shortcode.

    Is there an up-to-date solution for this?

    Basically I want my urls to look pretty for users:
    domain.com/food/post-name

    And I want the custom page to act as the top level page for the food category.

    Thank you for any assistance.

    #2157649
    David
    Staff
    Customer Support

    Hi there,

    there is is this method:

    https://docs.wpshowposts.com/article/use-static-pages-as-category-archives/

    but it requires ALL category archives to be swapped out with the same named static page.

    #2158849
    Lee

    Thank you, David, this got me half way there!

    My pages now display as intended and show posts using the wp_show_posts shortcode.

    However; when I click the ‘read more’ or image to go to the actual post, it just takes me back to the same page.

    For example:
    my post has slug: post-name

    My permalink setup is: domain.com/category/postname

    The link displays correctly on hover: domain.com/category/post-name/ but when I click it, it takes me to domain.com/category/ – the same page I’m on.

    It’s like the fix to display category archives as pages is now being applied to all posts too.

    Thank you again,

    #2158893
    David
    Staff
    Customer Support

    Try: Go to Settings > Permalinks and click Save Changes to rebuild your permalinks.

    #2158912
    Lee

    Thank you again, David.

    Unfortunately that didn’t fix the problem.

    I changed the post permalink structure to: /postname/ instead of /category/postname/ and that worked but of course in the browser bar the url for posts is now: domain.com/postname/

    I then switched back to try and update permalinks to domain.com/category/postname/ and the same thing happened as before where, when trying to view the post with url domain.com/category/postname/ the page simply reloads the domain.com/category/

    #2158930
    David
    Staff
    Customer Support

    Can you share a link to where I can see the issue ?

    #2158965
    Lee

    I’ve sent it over privately.

    Thanks.

    #2159003
    David
    Staff
    Customer Support

    hmmm… yeah, thinking about this I believe this has come up before … I assume this works if you put the permalinks back to default ie. remove /category prefix?

    #2159033
    Lee

    Yes, it works fine when you do that.

    #2159083
    David
    Staff
    Customer Support

    Yeah I don’t know a way around that, the Page doesn’t have the same structure ( because its a page ). You may find a custom permalink plugin that allows you to rewrite those URLS.

    #2161771
    Lee

    Thank yuo David for your help.

    I will roll with it. The page to archive fix will work for now.

    #2161868
    David
    Staff
    Customer Support

    You’re welcome

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