Custom Post Type UI
[resolved] Get Code not working in functions.php of my theme (1 post)

  1. Rincewind
    Posted 4 years ago #

    Hello I am using your plugin to make some custom post types and it creates them well and they work in the admin and on the front end, however if I click on the get code link and copy and paste that code into my themes functions.php file and delete the custom post type from your plugin interface, the custom post type still continues to work on the admin side, but on the site it no longer works.

    var_dump( get_post_types( array( 'public' => true, '_builtin' => false ), 'names' ) );

    The above code returns an empty array, but the same code doesn't do this when the custom post type is setup in your plugin, why is this ?

    You can see a copy of my register_post_type code here http://pastebin.com/YsHtYSiP

    I have the same issue as this person here http://core.trac.wordpress.org/ticket/18950 but I have tried the code submitted by Big Bagel, see below and this doesn't work either, the above functions still dont return anything for there custom post type.

    $args => array(
    'public' => true,
    'publicly_queriable' => true,
    'show_ui' => true,
    'show_in_nav_menus' => true,
    'exclude_from_search => false
    register_post_type( 'my_custom_post_type', $args );


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Post Type UI
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic