How to create a custom page template in wordpress ?

All custom page templates must start with the following code. It tells WordPress that the file is a custom page template, and sets the name of the template. Note: you can change Template name as per your requirement. just put the name which you want at the front of the “Template name:” File Creating In […]

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 […]