I have a website which shows alle posts from my wordpress on the startpage. thanks to Stephen Harris who helped me with this code I put in the functions.php:
add_action('pre_get_posts','wpse57309_alter_front_page_query');
function wpse57309_alter_front_page_query( $query ){
if( $query->is_main_query() && is_front_page() ){
if( !$query->get('post_type') ){
//post type is not set, the default will be an array of them:
$query->set('post_type',array( 'movies', 'music', 'featued'));
}
}
}
Now I have another problem: I am getting the titles for each section by using this code here:
<?php wp_reset_query(); ?>
<?php echo $post->post_type; ?>
in between h2 tags - but now on Startpage I get different names of the post type - but I'd like to have just: "Home" as Title... I tried it with is_home() and with is_front_page() but I had no luck.
Also the "post_type" is set to one specific on this page.
I have built in a filter which filters on click the posts using a &style=soul
but on startpage its now always one specific post_type. I guess its the last post's post_type...
Maybe someone has a hint?