Revision: 68921
Updated Code
at March 18, 2015 20:39 by burnandbass
Updated Code
function custom_posttype_in_home_loop($query) { if (is_home() && $query->is_main_query() || is_feed()) $query->set('post_type', array('post', 'demo')); return $query; } add_filter('pre_get_posts', 'custom_posttype_in_home_loop');
Revision: 68920
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at March 18, 2015 20:36 by burnandbass
Initial Code
function custom_posttype_in_home_loop($query) { if (is_home() && $query->is_main_query()) $query->set('post_type', array('post', 'demo')); return $query; } add_filter('pre_get_posts', 'custom_posttype_in_home_loop');
Initial URL
Initial Description
Add 'demo" posttype in main loop and also in the RSS feed
Initial Title
Custom posttype in homepage loop
Initial Tags
Initial Language
PHP