月別アーカイブで特定のカテゴリーを非表示
-
教えて下さい。
月別アーカイブで特定のカテゴリーのポストを非表示にしたいのですが、上手くいきません。
知識がないので、<?php query_posts(‘cat= を使ってみたりネットで探していろいろ試したのですが・・・上手くできませんでした。宜しくお願い致します。
<?php if (have_posts()) : ?>
<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 while ( have_posts() ) : the_post(); ?>
<article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<header class=”entry-header”>
<?php if ( has_post_thumbnail() ) : ?>
<div class=”post-thumb”>
<?php the_post_thumbnail(); ?>
</div><!– .post-thumb –>
<?php endif; ?>
<div class=”entry-meta clearfix”>
<div class=”pull-left”>
<span class=”entry-cats”><?php the_category(‘<span class=”comma”> / </span>’); ?></span><!– .entry-cats –>
</div><!– .pull-left –>
<div class=”pull-right”>
<span class=”entry-comments”>
<?php comments_popup_link( esc_html__( ‘0’, ‘tdmacro’ ), esc_html__( ‘1’, ‘tdmacro’ ), esc_html__( ‘%’, ‘tdmacro’ ) ); ?>
</span><!– .entry-comments –>
</div><!– .pull-right –>
</div><!– .entry-meta –>
<?php the_title( ‘<h1 class=”entry-title”>’, ‘</h1>’ ); ?>
</header><!– .entry-header –>
<div class=”entry-content”>
<?php
the_content();
wp_link_pages( array(
‘before’ => ‘<div class=”page-links”><span class=”page-links-title”>’ . esc_html__( ‘Pages:’, ‘tdmacro’ ) . ‘</span>’,
‘after’ => ‘</div>’,
‘link_before’ => ‘<span>’,
‘link_after’ => ‘</span>’
) );
?>
</div><!– .entry-content –>
<?php the_tags( ‘<div class=”entry-tags”>’, ‘ ‘, ‘</div><!– .entry-tags –>’ ); ?>
<?php get_template_part( ‘template-parts/author’, ‘section’ ); ?>
</article><!– #post-## –>
<?php endwhile; ?>
<?php endif; ?>
- トピック「月別アーカイブで特定のカテゴリーを非表示」には新たに返信することはできません。