WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom Post Type and Custom Taxonomies (3 posts)

  1. martcol
    Member
    Posted 1 year ago #

    I am trying to attach several custom taxonomies to a single Custom Post Type in a plugin (Organisation type and sub type and region).

    I can manage to get one taxonomy and the CPT to show in my dashboard but I'm stumbling over how to add other taxonomies.

    I'm not much of a coder but I think I now understand what the code is doing to register the post type and taxonomy but this next step is defeating me.

    Here is my current code: http://pastebin.com/J8xjSfAA.

    Thanks

  2. keesiemeijer
    moderator
    Posted 1 year ago #

    You're using the same function name "custom_taxonomy" twice. The conditional if ( ! function_exists('custom_taxonomy') ) prevents the second custom_taxonomy function being executed. Put all your taxonomy code into one function or change the function names to be unique.
    http://pastebin.com/zVCsD7Eq

  3. martcol
    Member
    Posted 1 year ago #

    Thank you for your help,

    I think I am back on track.

    I think I scratched, searched, stared, surfed and scrutinized for about 7 or 8 hours before posting my question. Somehow the pain of the problem is far outweighed by the relief of the solution!

    Martin

Topic Closed

This topic has been closed to new replies.

About this Topic