• Resolved Sara Die Webmacherin

    (@larvafashion)


    Hello WebDevStudios team,

    I have a theme (Avada) with some custom post types (Portfolio). Additionally I created a custom post type with CPT UI. These two should work together by sharing taxonomy.

    I can add a custom taxonomy with CPT UI and add it to both the existing and the new post type. This works fine.

    But if I try to add an existing taxonomy from the theme to the CPT UI post type, I can activate the checkbox in the post type settings, but the taxonomy doesn’t show up when editing a post of that type.

    I found some info about the taxonomy having to be accessible to the REST API. I added some code for activating this, and there is no change.

    I would prefer to use the existing taxonomies, since we already added quite a bit of content and I don’t want to reconnect everything to the new taxonomy.

    Any idea what the problem could be?

    Regards,
    Sara

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    But if I try to add an existing taxonomy from the theme to the CPT UI post type, I can activate the checkbox in the post type settings, but the taxonomy doesn’t show up when editing a post of that type.

    To clarify, this taxonomy is registered in the theme itself, not with CPTUI.

    You’re trying to add it to a post type that is registered via CPTUI, and the taxonomy is listed in the “Taxonomies” section at the bottom of the CPTUI Edit Post type screen?

    But things are failing beyond that, and when editing a post in that post type?

    Thread Starter Sara Die Webmacherin

    (@larvafashion)

    Yes, you got everything right.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    @larvafashion

    Can I also assume you’re making use of the block editor in this case, and not something like the classic editor?

    If yes, then those taxonomies will need to have show_in_rest set to true as part of their registration. However, since those are being done via the theme, that’s going to need to be a custom edit you make, nothing we can do from CPTUI.

    If that’s already set to true and you’re working with the block editor then I’m not sure what may be going on.

    Thread Starter Sara Die Webmacherin

    (@larvafashion)

    Thank you for the reply, I already tried to activate REST for the theme taxonomies. It doesn’t work for me and I don’t know how to debug that part.

    I think the effort for debugging is to high anyway, since I can use the CPTUI taxonomies with a bit of extra effort. I just thought maybe you had a solution.

    Thank you for your help!

    • This reply was modified 1 year, 2 months ago by Sara Die Webmacherin. Reason: Marked as resolved without solution
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I’m not ready to give up quite yet. ??

    Do you know where in the theme code the taxonomy in question is getting registered at?

    I’m wondering if it’d benefit from either a priority of 9 or a priority of 11 for its callback.

    Examples borrowed from CPTUI itself:

    add_action( 'init', 'cptui_create_custom_taxonomies', 9 );
    add_action( 'init', 'cptui_create_custom_taxonomies', 11 );
    Thread Starter Sara Die Webmacherin

    (@larvafashion)

    I can’t find anything related to taxonomies, but the other add_actions have a priority of 10, 5 or nothing.

    The Avada theme is rather complex, so it’s quite hard to find anything that isn’t relying on a lot of other code that I have to look up in turn.

    I can provide access to the Avada files or the website if that helps.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Looks like the version I have is back in the 5.x days, with the theme now in the 7.x range. Quick code search only found one instance of register_taxonomy but that may also be because just so old.

    Are you in a good overall spot with this? Or are you still wanting some information/help with anything?

    Thread Starter Sara Die Webmacherin

    (@larvafashion)

    Im am in a good spot. I am using only CPTUI taxonomies now. They work fine for CPTUI and other post types.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Sounds good. Maybe in the future it will get figured out, but until then, as you’re stating, things are in a good spot.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Existing taxonomy (from theme) doesn’t show up in custom post type’ is closed to new replies.