Support » Fixing WordPress » How do I get CPT's to show in the admin bar?

  • Hi. I’m trying to figure out how to create Custom Post Types.

    I’ve been mainly following this tutorial:

    I’ve created code for a CPT, modelling based on the code in that tutorial.

    Now that I’ve defined a CPT, I’d like to be able to create new posts of my type from the admin bar. The tutorial doesn’t provide details on how to do this.

    So, how can I configure my CPT so that new posts of this type can be created from the admin bar?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Drew Jaynes


    WordPress Core Developer

    Hi bobdobbs,

    I suggest you take a look at the show_in_admin_bar parameter of register_post_type in the Codex. Essentially, it traces back several levels to the public parameter, which is set to false by default. The easy way to make sure your CPT shows all over the admin is to set public to true when you register the post type.

    Hi Drew.

    I have set public to true, as per the tutorial, but I’m still not seeing anything new in the admin bar.

    This is my function so far:

    Drew Jaynes


    WordPress Core Developer

    I don’t know if this was a copy/paste error, but at the top of your pastbin, the ‘a’ in add_action is missing. I just tried your code and ‘Profile Page’ showed up in the ‘+ New’ dropdown for me just fine:

    Were you expecting something different?

    Yeah, that missing ‘a’ is just a copy/paste error.

    In my actual code I have the ‘a’.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How do I get CPT's to show in the admin bar?’ is closed to new replies.