WordPress.org

Ready to get started?Download WordPress

Forums

CPT-onomies: Using Custom Post Types as Taxonomies
[resolved] Export custom posts code (9 posts)

  1. Li-An
    Member
    Posted 2 years ago #

    Hello -twice :-)
    Your plugin is a very convenient way to create custom posts. It could be nice to export them as code to put into the functions.php file in the theme.

    http://wordpress.org/extend/plugins/cpt-onomies/

  2. Rachel Carden
    Member
    Plugin Author

    Posted 2 years ago #

    Hi there =)

    One of the best features of "CPT-onomies" is that it can simply be used to create custom post types if that's all you need. You don't HAVE to "register your custom post type as a CPT-onomy" to use the plugin.

    With that said, there's really no need to have code in your theme's functions.php file to create custom post types as long as you're using the "CPT-onomies" plugin.

    But if you still want the code for your functions.php file, the WordPress function register post type() will do the trick.

  3. Rachel Carden
    Member
    Plugin Author

    Posted 2 years ago #

    If you do decide to create custom post types in your theme's functions.php file, these custom post types can still be registered as CPT-onomies. They will show up in the "Other Custom Post Types" section and you can "edit" them to define the CPT-onomy settings.

  4. Li-An
    Member
    Posted 2 years ago #

    OK... Thanks for the answer.

  5. TiagoPires
    Member
    Posted 1 year ago #

    What if I'm creating a parent theme where the plugin was used to create the post types. I would need to output the post types as code into the functions.php of the parent theme so child themes see the post types. I'm I right?

    Thanks!

  6. Rachel Carden
    Member
    Plugin Author

    Posted 1 year ago #

    If you're wanting to define the same custom post types across all sites that use child themes of your parent theme then yes, the easiest method would be to register the custom post types in the functions.php file of your parent theme.

  7. TiagoPires
    Member
    Posted 1 year ago #

    Nice, I'd like all network to use the same post types. It's a network of country specific that relates courses to cities in a country. Both courses and cities are CPTs, and the sites will look very similar apart for minor css changes done in the child themes.

    I'm running a multisite install locally for development and registered the post types in the parent theme. I'm using the register_cpt_onomy() in the parent theme as well and the metabox for the city cptonomy show in all sites as you would expect. The current challenge for me is to make the city cptonomies show as a checkist (hierarchical) instead of a tags. I can't find that argument in the register_cpt_onomy() funciton.

    I may be stretching things but I really appreciate your work on this. beautifull :)

  8. TiagoPires
    Member
    Posted 1 year ago #

    Hey, I can see now (snippet overlooked), my post types definitions had 'hierarchical' set to false, and cptonomy, smart enough, follows the post type definitions :P all running smooth!

  9. Rachel Carden
    Member
    Plugin Author

    Posted 1 year ago #

    Yay! I'm glad you got everything working!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic