Sub Categories Not Pushing through to Child Sites - Just creates duplicate categories

I am publishing Custom Posts to child sites, which have a main category and a sub category.

E.g.

Free (main category)

  • Breakfast (sub category)
  • Lunch (sub category)
  • Evening Meal (sub category)
  • Desserts (sub category)
  • Snacks (sub category)

Members (main category)

  • Breakfast (sub category)
  • Lunch (sub category)
  • Evening Meal (sub category)
  • Desserts (sub category)
  • Snacks (sub category)

However, I am encountering an issue where MainWP is creating the categories upon each submission of a new post, and making duplicates of them.

So Iā€™m ending up with 1 recipe in desserts-members-2 (referring to the slug in the image), another in desserts-members-3, and so on. Instead there should be 7 recipes in desserts-members.

How the category listing should look.

It doesnā€™t do this if I just select a single 'main categoryā€™, only when I select ā€˜main category > sub categoryā€™.

Please can you advise.

This is how it should look

Hey @gemtech

Welcome to the MainWP community!

Iā€™ve tried to replicate your setup. Iā€™ve created two main categories and then two sub categories for each main category, but with the same names.

When creating a new CPT post, I encountered a bug, and I am curious if you are seeing this behavior. Namely, I would only see the sub categories of one main category:
image

This seems to be caused by the fact that sub categories have the same names, and when one of them is renamed to something unique, it shows up in the list:
image

However, I could not reproduce the issue youā€™ve originally reported.
When creating CPT posts under a subcategory, I did not get category duplication:

I see that in your image you have 1 item in SubCat1, 1 item in SubCat2, but only 1 item in MainCat1, is that because you did not select MainCat1 as the primary category when you posted it?

Then, another thing I notice is that your Custom Post Type may not be set up the same as I have checkboxes and not a lookup, so could it be to do with the configuration on the taxonomy? I have hierarchical = true , so the master site looks like this:-

But yes you seem close to replicating the issue because this is what Iā€™m getting in my Category listing.

image

The problem with it is that the recipe pages are all designed to show different layouts based on whether the user is a member or not. If they are a member they get to see ā€˜Freeā€™ MainCat posts and if theyā€™re a Member, they get to see both ā€˜Freeā€™ & ā€˜Memberā€™ MainCat posts and my templates are designed to show or hide based on their category.

So Iā€™m posting and nothing appears because all the recipes are assigned a category that doesnā€™t exist in the query.

Iā€™m attaching a GIF below to see how it looks for me on the Dashboard site.

I have defined the categories only on the Child site, and Iā€™ve done so under the standard Posts:

Then when creating the CPT Recipe post on the Dashboard site, it looks like this:
chrome_H7d3kLD0pk

I have not done any changes to how categories are presented in the UI.

I think I can see the difference here now, your categories are coming from the ā€˜Generic Postsā€™.
However, when creating Custom Posts, you usually want Custom Post Categories as well.
So I have a Custom Post Taxonomy set up also. This is called ā€˜Recipe Categoriesā€™.

I have a video showing you a custom post type without a taxonomy called Test Recipes and then my original one called ā€˜Recipesā€™ with its Taxonomy of ā€˜Recipe Categoriesā€™.

Video here:-
https://file.io/fgtgV4BBNmck

I hope it makes sense what Iā€™m showing/explaining in regards to the difference in your set up to mine. Thanks.

Thanks for making that video recording for us, @gemtech .

The reason why Categories arenā€™t populating in this moment is because you havenā€™t selected the child site:

As you can see in my gif, the category list is empty until I select at least one site:
chrome_H7d3kLD0pk

I would assume that if you were to select a child site, the category list will populate by Generic Posts Categories.

I will have to check with the development team if our CPT extension is designed to handle such Custom Post Categories.

Hey @gemtech

Iā€™ve checked with the development team.

Custom taxonomies should work with our extension so we will address that in the next release of our Custom Post Type extension.

However, it will still be necessary to first select a Child site and then their respective categories from the Categories widget below as seen here:
chrome_H7d3kLD0pk

The difference will be that in the new version, custom taxonomies will be visible in that list.

The ā€œRecipe Categoriesā€ widget visible on your MainWP Dashboard simply shows the custom taxonomies that are present on the Dashboard which does not play a role in how our extension works and will work in the next version.

Thanks Bojan,
Yes, this is correct. The Generic Post Categories will show up if I select a Child Site.

I have done a video showing exactly that. Where the ā€˜Recipes Categoriesā€™ custom taxonomy is visible on the ā€˜mainWPā€™ management site, but when selecting the Child Site, the only categories that can be selected is the ā€˜Generic postā€™ category, which are not used across any of our Child Sites.

Video Project 1.mp4

I look forward to the new update. Thanks.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.