Custom post type (with parent-child relationship) singular page with pagination

I managed to find a solution to my problem. Paste the following code into your functions.php file: function my_redirect_canonical($redirect_url) { if (is_singular(‘auction’)) { $redirect_url = false; } return $redirect_url; } add_filter(‘redirect_canonical’, ‘my_redirect_canonical’); Can someone please tell me what the redirect_canonical filter does? I’ve read some people recommending against touching it. Thanks

Get custom post type list for every category shortcode

You are not dealing with categories. You are dealing with a custom taxonomy. $postlist_args = array( ‘posts_per_page’ => -1, ‘offset’ => 0, // ‘category’ => $category->cat_ID, // not this ‘tax_query’ => array( array( ‘taxonomy’ => ‘cars_category’, ‘field’ => ‘id’, ‘terms’ => $category->term_ID, ) ), ‘orderby’ => ‘post_date’, ‘order’ => ‘DESC’, ‘post_type’ => ‘msccar’, ‘post_status’ => … Read more

Post form as custom post

Within your theme folder create a page names archive-{YOUR_POST_TYPE}.php. In your case archive-roadkills.php. Test whether your archive page is catching this page or not? If yes, then you can edit the page the way you like. Whether copying the code from existing archive.php or your own. Reference: Template Hierarchy Codex

Customize the Dashboard Menu Editor

I found the answer after I typed out the question so I’ll post it at the same time. The solution is to set the show_in_nav_menus option to false when registering the Custom Post Type. http://codex.wordpress.org/Function_Reference/register_post_type show_in_nav_menus (boolean) (optional) Whether post_type is available for selection in navigation menus. Default: value of public argument

Registering different Post Formats for Blog Post and CPT

I found an alternative approach. There is a unique class in body tag for each post type. e.g for portfolio post type i can use the CSS code something like mentioned below to hide the extra option. .post-type-portfolio #post-format-audio, /* for radio button itself */ .post-type-portfolio .post-format-audio /* for option label */ { display: none; … Read more

Custom Post Type With Categories

Hey Manan try this code: function codex_custom_init() { $labels = array( ‘name’ => ‘Prices’, ‘singular_name’ => ‘Price’, ‘add_new’ => ‘Add New’, ‘add_new_item’ => ‘Add New Price’, ‘edit_item’ => ‘Edit Price’, ‘new_item’ => ‘New Price’, ‘all_items’ => ‘All Prices’, ‘view_item’ => ‘View Price’, ‘search_items’ => ‘Search Prices’, ‘not_found’ => ‘No prices found’, ‘not_found_in_trash’ => ‘No prices … Read more