How to Control WordPress Custom Post Types, Capabilities and Roles

As We all knows about Custom Post Types and how to create them, when we create custom post types without Capabilities all users except subscriber roles can publish, read, edit and delete them by default. What if we wanted to create a custom post type that Author could read, edit and publish but Author Staff […]

Add a Custom Post Type Submenu To Another Post Type Menu

Custom Post Types are the most powerful features of WordPress, specially if you’re in the business of creating custom solutions for clients beyond normal bloging functionality. Introducing a new menu in the WordPress dashboard is really easy when using the custom post type API; however, what about the case when you have a custom post […]

Let’s Create a Custom Post Type !

Here we shall create a custom post type which will display portfolio. Lets started. Register Your Custom Function. Open your function.php of current theme. At the end of the function file, type the following line of code to execute the custom function named create_portfolio during the initialization phase every time a page is generated. Function […]

Create WordPress Custom Post Type Archive PageTemplates

Post Type Templates Custom Post Type Templates archive-{post_type}.php single-{post_type}.php archive-{post_type}.php  If the custom post type were ‘product’, WordPress would look for archive-product.php to display the archive of posts. single-{post_type}.php  If the custom post type were ‘product’, WordPress would look for single-product.php to display the single or permalink of the post. If these files are not […]

How to Create a Custom Post Types Archive Page in WordPress

If you want to show your custom post types on your category archive pages? Add this to your functions.php file: add_filter(‘pre_get_posts’, ‘query_post_type’); function query_post_type($query) { if(is_category() || is_tag()) { $post_type = get_query_var(‘post_type’); if($post_type) $post_type = $post_type; else $post_type = array(‘post’,’myCustomPostTymeName’); // replace myCustomPostTymeName to your custom post type $query->set(‘post_type’,$post_type); return $query; } } Now change […]