Jebaloo
Member
Posted 4 years ago #
Hi,
Please see the right side panel on my site: http://lacrossescotland.com/
There is a Recent News section, and the code for this is:
<h2>Recent News:</h2>
<?php if (in_category('General') && is_home() ) stop; ?>
<?php get_archives('postbypost', 3); ?>
I would like to know how to exclude all categories from the Recent News, except for 'General'.
I'm sure this is simple, but I've searched everywhere and can't find it.
Any help would be greatly appreciated.
Thanks.
Jebaloo
Member
Posted 4 years ago #
I've found out how to exclude just one category (code below), but still can't work out how to only show one category of news entries:
<li id="Recent">
<h2>Recently Written</h2>
Any help on this would be awesome.
Jebaloo
Member
Posted 4 years ago #
<li id="Recent">
<h2>Recently Written</h2>
<ul>
<?php $temp_query = $wp_query; query_posts('showposts=10&cat=-88'); ?>
<?php while (have_posts()) { the_post(); ?>
<li><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to “<?php the_title(); ?>”"><?php the_title(); ?></a></li>
<?php } $wp_query = $temp_query; ?>
</ul>
</li>
Sorry for the previous posts's scrambled code.
Jebaloo
Member
Posted 4 years ago #
Jebaloo
Member
Posted 4 years ago #