I would like to do the following:
I have a index.php file in which I query all posts from the existing post_types. Like the code below.
<?php if (is_home()); { ?>
<?php
global $wp_query;
query_posts( array('post_type' =>
array( 'movies',
'music', 'featured' ),'showposts' => 10, 'paged'=>$paged )
);?>
<?php }?>
I have a navigation menu e.g. "Movies" which url links to ?post_type=movies
and so on.
But when I use it, everytime all posts are shown. When I delete the code above from the index.php everything works. Only the posts of a specific post_type are shown.
I only want to have all posts from all custom post types, when it is really the websites home url. How could I do it?
is there maybe an option to create a customposttype.php
or so? like the taxonomy.php
?
thank you!
AD
Hi Stephen, I have another question: I am getting the titles for each section by using this code here:´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. Do you have a hint? Thank you very much!!