Include One category code !
-
Hi All,
So after reading lots of posts checking “the loop” docs I couldn’t find what I want :
So i want to include a “file.php” in my Home page which display ONLY One category like as “https://lesartisans.org/” (my Beta) but my main problem is that when i change page by clicking in a post (eg.https://lesartisans.org/2006/11/30/test-du-linksys-wip330-un-telephone-multiplateformes-wi-fi/) is displaying
not anymore the same results !How to keep this middle column that contaimn my category style the same ???
Thanks !
PS : Here is the code of the “middle-col.php” page :
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!– If the post is in the category we want to exclude, we simply pass to the next post. –>
<?php if (in_category(‘1’) || in_category(‘2’) || in_category(‘3’) || in_category(‘4’) || in_category(‘8’) || in_category(‘9′) || in_category(’10’) || in_category(’11’) || in_category(’12’) || in_category(’13’) || in_category(’14’) || in_category(’15’) || in_category(’16’)) continue; ?><div class=”post”>
<h2>“><?php the_title(); ?></h2>
<h3><img src=”<?php bloginfo(‘stylesheet_directory’); ?>/images/timeicon.gif” alt=”” /> <?php the_time(‘jS F Y’) ?> by <img src=”<?php bloginfo(‘stylesheet_directory’); ?>/images/author.gif” alt=”” /> <?php the_author() ?> </h3>
<div class=”entry”>
<?php the_content(); ?>
</div><p class=”postmetadata”>Posted in <?php the_category(‘, ‘); ?></p>
</div> <!– closes the first div box –><?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
- The topic ‘Include One category code !’ is closed to new replies.