Site logo

Archived topic

posts not showing up under proper categories

17 replies · Started by Alana on June 1, 2019

Viewing posts 1–15 of 18

Hi,

I set up my website structure as follows:

-Destinations (category)
*North America (subcategory)
*Central America (subcategory)
*Europe (subcategory)
*Asia (subcategory)

-Travel Smarter (category)

I would like my blog posts to show up under both their proper category and subcategory. For the post I published as a test I checked "Destinations" and "Asia" on the post categorization page. However, the post is only showing up in Destinations.

(1) I am concerned that the structure I have envisioned above is not the structure that I've executed. Any help checking would be appreciated (I really want to have logical URL pathways reflecting that structure)

(2) When I use the primary navigation menu to click on any of the drop-down options like the "Asia" subcategory, I get a "page not found" message - the blog post should theoretically show up there.

Thank you for your help! I really want to get the structure of the site right so the right posts show up in the right places :)

Strange, I'm getting a 404 error on all of the pages. Is this a custom post type/custom taxonomy? Can you try clicking the "Save" button in "Settings > Permalinks"?

Hey Tom, thanks for the reply!

I don't think it's a custom post type/custom taxonomy (since I have no idea what that is lol) - feel free to look at Appearance - Menu Structure.

Under "Settings" "permalinks" I have it marked as "custom structure" https://www.coursecharted.com/%category%/%postname%/ and under "Optional" "category base" I have a "." (because I didn't want the word "category" to show up in the URL but maybe I did something wrong by going this route?)

Please let me know your thoughts; I'm feeling very lost trying to get my categories and posts to show up properly.

Thanks again, I really appreciate it!

If you use the regular "Post name" permalink structure, does the issue go away?

Thanks Tom! That does help but then the word "category" shows up in the URL. Is there a clean fix for that so that I can have shorter URLs showing just [category name] / [subcategory] / [post]?

I know there are widgets that do this but I'm hoping for a simple alternative so that I don't bog the site down with unnecessary code. Thanks again, you're the best!

Hi there,

the custom structure you had before should do exactly that ie. /%category%/%postname%/ and there should be no need for you to edit the category base

Hey David, Tom's suggestion to use the regular “Post name” permalink structure is what fixed the original issues. Won't the custom structure (what I originally had) bring back those issues? Or was the issue caused by the "." in the category base?

Also, will /%category%/%postname%/ show the proper category-subcategory labels in the permalink (while leaving out the word "category")?

For example, the current post I'm testing has the "destinations" category and the "asia" subcategory. So I'm hoping the URL follows that same structure [coursecharted.com/destinations/asia/{post name}] Thanks again Tom and David!

That custom structure is what WP states should be used to display url/parent-category/child-category/post-name - not sure its not working, maybe the category base was the issue.

When I do that the word "category" is showing up in the URL which is what I wanted to hide. This custom option does not change the structure of the URL from just using the "post name" permalink option. Help with removing the word "category" from the URL would be appreciated.

In your posts do you have the Category and the Sub Category both selected?
If so try just selecting the Sub Category.

I have both selected because I want that particular post to show up under both the category and subcategory.

Can you try setting it to just the sub category to see if having both selected is causing the problem.

I tried it but that did not fix the issue. From what I've researched so far, it seems like it goes back to the way the theme is coded (but I don't want to mess with the underlying code so was hoping you or Tom could help by inserting the right code to make the word "category" in the URL go away)

The theme doesn't effect how the permalinks are generated. This is controlled by WP.

So to test i added the Custom Permalink of:

/%category%/%postname%/

On this post, i created a sub category and only selected that ( not its parent ):

https://merch.assemblewp.com/merch-styling/sub-category/plugins/

As you can see the permalink contains the full breadcrumb trail. If this doesn't work for you then there must be something else interfering. Can you check those settings to see if that works?

I've tried the same permalink selection and I've tried removing the parent category designation on the post option. Still now working. The word "category" continues to appear in the URL.

This archived topic is closed to new replies.