To change the design for each category
Categories: Design
2008-08-19 Last update:
2008-03-18: Sun Posts
If you want to change the design in each category, discovered that only by changing the file name can be realized. I tried to try.
create a category-XX.php file
Where XX is the input of the category ID (for example: category-2.php). If you want to apply the same design in all categories,
"Category.php"
Assuming good.
Priority category-XX.php> category.php way
Achieved in the following way.
- Check the ID of the category you want to change from → "category" "Administration" in the admin area.
- Changed to "category-6.php" in the folder the "index.php". ※ In this blog hit the News category.
- Change the file in a suitable, make sure to upload to the server.
Well, too easy. WordPress is an excellent tool might fairly.
Besides, if you introduce a Themed Categories Plugin, or likely to be selected from the management screen.
The problem of an individual article page is only one.
When I moved to the current situation and an individual article, "index.php" would have been applied.
Tentatively, the following is that we created this category-6.php. No different from "index.php" because most tests.
<?php get_header(); ?>
<div id="body">
<div id="contents"><div id="content">
<p>これはお知らせカテゴリのページです。</p> ←ここだけ変更
<!-- 最新記事のループ表示 -->
<div class="post">
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<?php the_content() ?>
記事のリンク先URL:<?php the_permalink() ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
<div class="pagelink"><?php posts_nav_link(' | ', '前のページ', '次のページ'); ?></div>
</div>
<!-- 最新記事の表示 -->
</div><!-- content-end --></div><!-- contents-end -->
<?php get_sidebar(); ?>
</div><!-- body-end -->
<?php get_footer(); ?>
- タグ
- category.php , カテゴリ , デザイン
- トラックバックURL




























