Struggling with /categories/ link
-
Hi! I’m struggling with the list of posts shown under my categories link, like this: https://chrisandlisa1.wordpress.com/category/running/. I suspect there’s something simple that I’ve done wrong, but have not been able to figure out what.
I’ve added a Categories block at the end of my post (for example: https://chrisandlisa1.wordpress.com/2024/01/23/the-case-for-the-race-day-theme-song/), hoping that the link for this category would take me to a page showing all my other posts in the same category. The link takes me to https://chrisandlisa1.wordpress.com/category/running/, as expected. However, this page includes all posts from all categories in my site (so far, I only have 2 categories). Same thing happens with a tags block – takes me to https://chrisandlisa1.wordpress.com/tag/music/, but that page lists all of the posts in my site.
I can also add a Categories List block, which will correctly show the post counts per category, but same problem that the target of the link includes all of my posts.
I saw some other helpful articles in this forum suggesting to change the toggle for ‘inherit query from template’ in my template editor, but could not figure that out. I found the ‘single posts’ template and tried to edit that, but I did not see a query loop block to edit in that template. I’m not sure that’s actually my issue, though. It seems more likely that I’ve mismanaged my categories & tags some how because pages like https://chrisandlisa1.wordpress.com/category/running/ include all posts, not just the posts in the ‘running’ category.
Thanks for your help!
The blog I need help with is: (visible only to logged in users)
-
I would suggest checking your individual posts to see if they may have multiple categories/tags set. You may have inadvertently added the running and family history category to the same post.
If this is not the case, then I would suggest removing all tags and categories from your content. Then go back and try again setting the categories and tags. You can check in between each change to make sure the pages are collating properly.
-
Thank you for the response, @parkdanil!
I double checked that there were no posts with multiple categories. Looks good there.
I went and removed the ‘Running’ category from all posts (by unchecking the Running Category on the post. I did not check the Uncategorized Category).
Behavior is interesting. When I go to https://chrisandlisa1.wordpress.com/running/, it successfully loads a page with no posts. As expected. This is a page in my site that only displays posts in the Running Category. However, when I go to https://chrisandlisa1.wordpress.com/category/running/, I land on the page with Category: Running at the top and a list of all of the posts in the site (those with and without a Category selected. Also noticed that if I go to some other page, like https://chrisandlisa1.wordpress.com/catastrophe/running/ or https://chrisandlisa1.wordpress.com/a/running/, I get redirected to https://chrisandlisa1.wordpress.com/running/. So, it seems to be just the builtin page https://chrisandlisa1.wordpress.com/category/running/ that has the surprising behavior.
I see that you suggested I remove the category from all of the posts in our site and I can try that to see if it makes a difference after checking with the owner of those posts. Although, based on the behavior when I remove the Category from my posts, I’m not sure it will make much difference.
Do you think the Categories and the Tags behavior are linked? That is, do I need to remove all tags in addition to all Categories from posts to test the behavior of https://chrisandlisa1.wordpress.com/category/running/?
Thanks for your help, I really appreciate it!
-
The category and tag feed pages will automatically aggregate any posts that include either identifier. However, to the best of my knowledge, they are separate functions.
I don’t believe you will need to remove the tags unless you are also experiencing the same issue on the equivalent tag feed.
There may be other issues in the background that I am unaware of, so I have pinged the mod for support.
-
Thank you for sticking with this, @parkdanil!
I’ve now removed the Category from all of the posts in our site.
When I go to https://chrisandlisa1.wordpress.com/category/running/ and https://chrisandlisa1.wordpress.com/category/family-history/, the behavior is the same. Top of the page shows ‘Category: <categoryName>’ and under that there is a list of all of the posts in the site.
When I go to the specific pages that we published, https://chrisandlisa1.wordpress.com/running/ and https://chrisandlisa1.wordpress.com/family-history/, the page says ‘No results found’, which is expected at this point.
-
Hi @chrisandlisa91 that is correct, the default behaviour is to append the word Category or Tag to the beginning of the page title. The automated process WordPress uses does not connect the content to the pages that you have made manually using your preferred URL structure and title.
However, you can consider adding either the Blog Posts block or the Query Loop block into those pages, and that is a way you can quickly add a dynamic feed of blog posts. Both of these options include the ability to add a filter, so the output is limited to a specific tag or category.
Either block will result in a blog post feed on your page, but they can differ in their appearance and customization details. For the fastest/easiest path, we recommend the Blog posts block, if you want a whole bunch of (possibly too many?) customization options the Query Loop block is a better fit.
We show how you can add both in this webinar:
-
Thanks, @staff-totoro!
One thing we are trying to understand is the behavior of the page at https://chrisandlisa1.wordpress.com/category/running/. That page is showing all of the posts in our site, even though all categories have been removed from all posts. Is this the expected behavior? Could you help us understand?
-
Accepted answer
It appears that the Archive Page template of your theme isn’t configured to display posts from a specific category. Consequently, it displays all posts since no category is specified.
To resolve this issue, navigate to the Site Editor and select the All Archives template. Then, adjust the query loop settings to enable “Inherit query from template,” as demonstrated here:

. That should resolve the issue! If you have any questions or require further assistance, please don’t hesitate to ask.
-
Thank you, @staff-heroponriki, that did the trick.
We had heard that we needed to flip the toggle on the ‘inherit query from template’ config item, but had not been able to locate the right place in the editor to make the switch. This led us right there!
-
- The topic ‘Struggling with /categories/ link’ is closed to new replies.