- This topic has 11 replies, 2 voices, and was last updated 3 years, 5 months ago by
David.
-
AuthorPosts
-
March 16, 2022 at 6:14 pm #2157312
Lee
I want to create topic groups for my blog posts; for eg:
– Food
– Energy
– SkillsThe 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-nameAnd I want the custom page to act as the top level page for the food category.
Thank you for any assistance.
March 17, 2022 at 3:22 am #2157649David
StaffCustomer SupportHi 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.
March 18, 2022 at 3:01 am #2158849Lee
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-nameMy 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,
March 18, 2022 at 3:51 am #2158893David
StaffCustomer SupportTry: Go to Settings > Permalinks and click Save Changes to rebuild your permalinks.
March 18, 2022 at 4:35 am #2158912Lee
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/
March 18, 2022 at 4:54 am #2158930David
StaffCustomer SupportCan you share a link to where I can see the issue ?
March 18, 2022 at 5:37 am #2158965Lee
I’ve sent it over privately.
Thanks.
March 18, 2022 at 6:27 am #2159003David
StaffCustomer Supporthmmm… 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?March 18, 2022 at 6:55 am #2159033Lee
Yes, it works fine when you do that.
March 18, 2022 at 7:41 am #2159083David
StaffCustomer SupportYeah 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.
March 21, 2022 at 2:33 am #2161771Lee
Thank yuo David for your help.
I will roll with it. The page to archive fix will work for now.
March 21, 2022 at 4:08 am #2161868David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.