사용자 정의 분류 (카테고리와 같은)를 사용할 수있는 WordPress 템플릿을 작성 중입니다. 나는 그 게시물의 카테고리를 클릭 할 때마다 그 카테고리의 게시물 목록을 보여주기를 원한다. 여기 내 category.php입니다.해당 분류의 게시물 목록을 표시 할 수있는 분류 아카이브를 작성하는 방법
<?php get_header(); ?>
<body>
<div id="container">
<div id="header"><h1><a href="<?php echo get_option('home'); ?>"><?php bloginfo('name'); ?></a></h1></div>
<div id="menu"><?php wp_nav_menu(array('sort_column' => 'menu_order', 'menu_class' => 'nav', 'theme_location' => 'primary-menu')); ?></div>
<div id="content">
<div id="blog">
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h2>Archive for the ‘<?php single_cat_title(); ?>’ Category:</h2>
<?php /* If this is a tag archive */ } elseif(is_tag()) { ?>
<h2>Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2>Archive for <?php the_time('F jS, Y'); ?>:</h2>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2>Archive for <?php the_time('F, Y'); ?>:</h2>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2>Archive for <?php the_time('Y'); ?>:</h2>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2>Author Archive</h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2>Blog Archives</h2>
<?php } ?>
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<div class="post">
<br>
<br>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div class="entry">
<br>
<?php the_content(); ?>
<p class="postmetadata">
<?php _e('Filed under:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php the_author(); ?><br />
<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> <?php edit_post_link('Edit', ' | ', ''); ?>
</p>
</div>
<br>
<hr>
<br>
</div>
<?php endwhile; ?>
<div class="navigation">
<?php posts_nav_link(); ?>
</div>
<?php endif; ?>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
이미 하루 종일 검색 중이며 아무 것도 작동하지 않습니다. 내가 사용해야 할 사용자 정의 분류 아카이브 템플리트 아카이브 이름은 무엇입니까? 클릭 한 택 소노 미와 관련된 모든 게시물을 표시 할 수있는 맞춤 분류학 아카이브를 표시해야하는 필요성을 충족시키기 위해이 category.php에서 변경해야하는 코드는 무엇입니까?
:
이에 대한 추가 정보를 원하시면 다음 링크를 확인할 수 있습니다. 페이지를 찾을 수 없음 –
분류 체계를 등록 할 때'public'을'true'로 설정 했습니까? 또한 퍼머 링크를 플러시 했습니까? –
예 public 속성을 true로 설정했지만 permalink도 플러시하지만 nothings가 변경되었습니다. \t 여기 분류법을 등록하는 코드는 다음과 같습니다. jsfiddle.net/bkrs2bvk –