Multiple categories per listing within same CPT
This topic contains 13 replies, has 3 voices, and was last updated by Alex Rollin 6 years, 8 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
January 31, 2019 at 7:48 am #466361
Hello
I’m testing uploading listings via CSV.
In the field ‘post_category’ I’m entering the category and sub-category ID in the format ‘XX,XX’.
Both categories show at the top of the listing but only one (the parent) category is showing with a number on the published listing (see attached). The sub-category shows as having zero listings in it but displays the listing when clicked on.Is there a way to have a listing part of a category and sub-category?
Thanks
MattJanuary 31, 2019 at 7:48 am #466363This reply has been marked as private.January 31, 2019 at 8:06 am #466364Hi Matt,
Thanks for your post. You shouldn’t include the Category ID when importing new sub-categories and let WP assign IDs itself. Could you give it another try and see if it helps?
Thanks!
January 31, 2019 at 8:57 am #466370Thanks Kor.
I’ve already created all the categories and sub categories and am using the id’s that have already been generated. Hope this helps 🙂January 31, 2019 at 3:14 pm #466429After you import listings, run the term count tool
https://wpgeodirectory.com/docs-v2/geodirectory/status/#term-countsAs described here:
https://wpgeodirectory.com/docs-v2/geodirectory/settings/import-export/#recommendedFebruary 6, 2019 at 1:10 am #467340Thanks Alex! 🙂
February 6, 2019 at 1:47 am #467344You’re welcome 🙂
February 13, 2019 at 1:51 am #468614I’ve exported a CSV of current listings and noticed there were some differences with the example CSV, the main one being the exported CSV included a ‘default category’ field.
I’ve updated the exported CSV, re-uploaded it (updating the listing if the post ID already exists) and run the term count tool.
Now I’ve got the listing showing against the subcategory ‘financial planning’ (it shows a count of 1 – see attached image) but not against the parent category ‘Financial and Professional Services’ (which shows a count of 0). Should it be showing a value of 1 for each of these?
The ‘default category’ was set to the ID for ‘Financial Planning’.
Have I missed something?
Thanks in advance
MattFebruary 13, 2019 at 2:35 am #468619No,unless explicitly selected, the parent category count will not be incremented by adding a listing to the subcategory.
February 13, 2019 at 3:46 am #468621Thanks Alex. Would I need to (or can I) make more than 1 default category?
February 13, 2019 at 3:57 am #468622You can add as many categories as you like but only one default category.
https://wpgeodirectory.com/docs-v2/places/categories/#default-categoryFebruary 13, 2019 at 4:22 am #468623Thanks Alex. Should the parent category (in my case ‘Financial and Professional Services’) also be showing a value (of 1 instead of 0)?
Because all my listings will be linked to sub-categories, I wanted the parent category to show the total listings of its sub-categories. At the moment only the sub-category shows as having a listing (1), while the parent category shows zero listings. Is this how it works?
Thanks
MattFebruary 13, 2019 at 5:41 am #468626Ok I think I’ve figured out what’s been happening. It looks like CSV values for post_category needed to start with a comma. For example I had entered:
130,131,
and during the CSV import it had stripped away 130 and left me with 131
Also there were pricing packages in play meaning the default package that listings uploaded with only allowed one category…
Sheesh!!
Thanks for your help Alex, hopefully this has sorted it! 🙂
February 13, 2019 at 3:01 pm #468687The commas should be ok, it is probably the package that was the hangup.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket