Hallo, ich habe wieder ein Problem.
Diesmal wollte ich meine-domain.de/xxx (also so eine Art SubDirektly), nur mit Custom Post Type machen.
Anscheinend funktioniert aber archive-xxx.php nicht. Also wenn ich die Seite meine-domain.de/xxx aufrufe, kommt, dass nichts gefunden wurde.
Das hab ich(s.u.) Kann mir jemand helfen?
PHP
<?php
get_header(); ?>
<section id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
$loop = new WP_Query(array("post_type" => "xxx"));
if ( $loop->have_posts() ) : while($loop->have_posts()): $loop->the_post();
?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
?>
</header><!-- .page-header -->
<?php
// Start the Loop.
while ( have_posts() ) : the_post();
get_template_part( 'content', get_post_format() );
// End the loop.
endwhile;
// Previous/next page navigation.
the_posts_pagination( array(
'prev_text' => __( 'Previous page', 'twentyfifteen' ),
'next_text' => __( 'Next page', 'twentyfifteen' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>',
) );
// If no content, include the "No posts found" template.
else :
get_template_part( 'content', 'none' );
endif;
?>
</main><!-- .site-main -->
</section><!-- .content-area -->
<?php get_footer(); ?>
Alles anzeigen