Creat new admin url for custom post type

You want (probably) add_submenu_page. The first parameter– the one listed as $parent_slug in the Codex is going to be edit.php?post_type=your-post-type-name, like this (mostly cribbed from the Codex page): function add_submenu_wpse_81844() { add_submenu_page( ‘edit.php?post_type=your-post-type-name’ , ‘My Custom Submenu Page’ , ‘My Custom Submenu Page’ , ‘manage_options’ , ‘my-custom-submenu-page’ , ‘my_custom_submenu_page_callback’ ); } add_action(‘admin_menu’, ‘add_submenu_wpse_81844’); Check the … Read more

Add a ‘guide’ image to custom post type admin page

You could add a custom help Simple example taken from here function mqw_example_contextual_help( $contextual_help, $screen_id) { # Uncomment this to see actual screen # echo ‘Screen ID = ‘.$screen_id.'<br />’; switch( $screen_id ) { case ‘mycustompostname’ : //Your custom post name //Just to modify text of first tab $contextual_help .= ‘<p>’; $contextual_help = __( ‘Your … Read more

How can i display movies in profile page, added by an user?

how can i retrive all the movies, i retrive only the amount set in Administrtor setings. How can i retrive the pages too Assuming that $current_user->ID is now correct, and it seems from your comment that it is. $recentPosts = new WP_Query(); $recentPosts->query( array( ‘author’ => $current_user->ID, ‘post_type’ => array(‘post’,’trailers’), // pull both posts and … Read more

Ascending Order is not Working in Custom Post Type Listining

If you want to sort the custom post type ‘product’ by title, please try: array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 10, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘genre’, ‘field’ => ‘slug’, ‘terms’ => ‘ne’, ) ) ) where ‘field’ can in general be either ‘id’ or ‘slug’ (ref). You … Read more

How to keep a CPT from being visible on the front end?

I think that at least part of what you want is to alter the submission update messages, probably in addition to @toscho’s code. function kill_message($messages) { global $post_type; // var_dump($messages); die; if (‘your-cpt-slug’ == $post_type) { // alter your message strings } return $messages; } add_filter( ‘post_updated_messages’, ‘kill_message’ ); If you var_dump the $messages variable … Read more

Set templates for custom post types

If your theme and plugins follow the basic WP template hierarchy and different content types actually have their own custom post types, you should be able to achieve this through template naming. Learn more from http://codex.wordpress.org/Post_Type_Templates and http://codex.wordpress.org/Template_Hierarchy Unfortunately many plugins (and some themes too) have their own template structure and this might cause problems. … Read more

How to automatically and randomly reorder custom post type?

Or the pre_get_posts approach for the CPT archive…. which is more efficient since you don’t query twice. function wpa104766_randomize_cpt( $query ) { if ( is_admin() || ! $query->is_main_query() ) return; if ( is_post_type_archive( ‘movie’ ) ) { // Display custom post type called ‘movie’ in random order set_query_var( ‘orderby’, ‘rand’ ); return; } } add_action( … Read more

Custom post types: change “read more” text

Hmm, and what is the difficulty in here? You already have global $post variable in your function. Just use it. function excerpt_read_more_link($output) { global $post; $text=”Read more”; if ( $post->post_type == ‘MY-CUSTOM-POST-TYPE’ ) // change MY-CUSTOM-POST-TYPE to your real CPT name $text=”Get it now”; return $output . ‘<a class=”more-link” href=”‘. get_permalink($post->ID) . ‘”>’. $text .'</a>’; … Read more