My problem is to display the content of custom post types.
The Dashboard-preview shows the right content (/vita/vita-test/), but I can’t see it at the homepage ( /vita/ ). It displays the content of index.php
Why isn’t found âvita-testâ?
My permalink is /%post_id%/%postname%/
my post type $args
'rewrite' => array("slug" => "vita"),
'show_in_nav_menus' => true
I also use
query_posts('post_type=vita&post_status=publish');
if ( have_posts() ) : while ( have_posts() ) : the_post();
Do you have an idea where my mistake is?
Thanks so much!
You need to register you post type with the
has_archive
argument to get an archive page at/<post_type_slug>/
.Eg.
You might want read through the arguments for
register_post_type
. You also don’t need to include query posts like that. WordPress will setup the correct post type and status based on the current request — no need to do that manually.