Custom Post Type = Page; show in Menu?
-
I have a custom post type called “Artwork”. Works great!
I now want to create custom “Gallery” pages so that I can specify search criteria for how each Gallery page displays. These would be custom posts with a capability_type = “page”. I want to place these Gallery pages into the menu.
There are two issues I have run into:
1) the “page template” selection is not showing up on the edit page even though I have supports = “page-attributes” enabled.
2) These new Galleries are not showing up in Appearance->Menus even though I have specified “show_in_nav_menus=true.
Am I missing some extra setting that is required to make these custom post types truly into pages?
If you know of tutorials for this online, point me toward them please, I haven’t found any yet.
I’ve got the following specification for Gallery:
function gallery() { $args = array( 'label' => __('Galleries'), 'singular_label' => __('Gallery'), 'public' => true, 'show_ui' => true, 'capability_type' => 'page', 'hierarchical' => true, 'rewrite' => true, 'supports' => array('title', 'author', 'editor', 'thumbnail', 'page-attributes'), 'show_in_nav_menus' => true ); register_post_type( 'gallery' , $args ); } add_action("admin_init", "gallery_init"); function gallery_init(){ add_meta_box("gallery-meta", "Limit Gallery to...", "gallery_meta", "gallery", "side", "default"); } function gallery_meta(){ global $post; $custom = get_post_custom($post->ID); $gallery_category = $custom["gallery_category"][0]; ?> <p><label>Category:</label> <select name="gallery_category"> <option value="0">Select Category</option> <?php $categories= get_categories(); foreach ($categories as $category) { $option = '<option value="' . $category->cat_id . '"'; if ($gallery_category == $category->cat_id) $option .= ' selected>'; else $option .= '>'; $option .= $category->name; $option .= '</option>'; echo $option; } ?> </select> <?php } add_action('save_post', 'save_gallery'); function save_gallery() { global $post; if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post->ID; update_post_meta($post->ID, "gallery_category", $_POST["gallery_category"]); }
Your help is greatly appreciated
- The topic ‘Custom Post Type = Page; show in Menu?’ is closed to new replies.