Multiple categories per listing within same CPT

This topic contains 13 replies, has 3 voices, and was last updated by  Alex Rollin 5 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #466361

    Anna
    Full Member
    Post count: 70

    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
    Matt

    #466363

    Anna
    Full Member
    Post count: 70
    This reply has been marked as private.
    #466364

    Kor
    Moderator
    Post count: 16516

    Hi 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!

    #466370

    Anna
    Full Member
    Post count: 70

    Thanks 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 🙂

    #466429

    Alex Rollin
    Moderator
    Post count: 27815
    #467340

    Anna
    Full Member
    Post count: 70

    Thanks Alex! 🙂

    #467344

    Alex Rollin
    Moderator
    Post count: 27815

    You’re welcome 🙂

    #468614

    Anna
    Full Member
    Post count: 70

    I’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
    Matt

    #468619

    Alex Rollin
    Moderator
    Post count: 27815

    No,unless explicitly selected, the parent category count will not be incremented by adding a listing to the subcategory.

    #468621

    Anna
    Full Member
    Post count: 70

    Thanks Alex. Would I need to (or can I) make more than 1 default category?

    #468622

    Alex Rollin
    Moderator
    Post count: 27815

    You can add as many categories as you like but only one default category.
    https://wpgeodirectory.com/docs-v2/places/categories/#default-category

    #468623

    Anna
    Full Member
    Post count: 70

    Thanks 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
    Matt

    #468626

    Anna
    Full Member
    Post count: 70

    Ok 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! 🙂

    #468687

    Alex Rollin
    Moderator
    Post count: 27815

    The commas should be ok, it is probably the package that was the hangup.

Viewing 14 posts - 1 through 14 (of 14 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount