In blog

Designing template for specific Wordpress category such as Blog, News etc. This code will show the category template which shows featured image and title in the WordPress category archive. Category template file

  • category-slug.php (Note: available with Version 2.9)
  • category-ID.php
  • category.php
  • archive.php
  • index.php

in our case category id is 16 [code]</pre> <div class="twelve columns bg-white"></pre></pre></pre> <h1><!–?<span class="hiddenSpellError" pre=""–>php single_cat_title(); ?></h1> <pre> <pre> <pre> <!–?<span class="hiddenSpellError" pre=""–>php $recent = new WP_Query(); ?> <!–?<span class="hiddenSpellError" pre=""–>php $recent->query(‘cat=16&showposts=5’); ?> <?php while($recent->have_posts()) : $recent->the_post(); ?> <div class="four columns category-temp"> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail(); ?> <?php the_title(); ?> </a> </div> <!–?php <span class="hiddenSpellError" pre="php "–>endwhile; ?> </div> <pre> [/code] Enter your category id in: cat=16 Display number of post in: showposts=5

Recommended Posts
0