Simple Exclude Code
-
I am trying to remove one thumbnail from my front page.
I am using a plugin called Thumbnails for Excerpt because my theme didn’t have them for category searches.My problem is this, the plugin includes an expert with a thumbnail to the front page. It so happens that so does my theme. This doubled it up. The plugin writer sent me a little code to get rid of this on my front page. Here is the code:
if(is_single()) return;
if(is_home()) return $excerpt;
That cleared up everything but that one duplicate thumbnail on the main story. I am trying to exclude that redundant thumb. Can someone help me with the code?Here is my index page code. It is the part called Lead story…
<?php get_header(); ?>
<div id=”content”><div class=”feature clearfloat” id=”lead”>
<?php
// this is where the Lead Story module begins
query_posts(‘showposts=1&cat=40’); ?>
<?php while (have_posts()) : the_post(); ?>
” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><img src=”<?php bloginfo(‘template_url’); ?>/images/<?php
// this is where the Lead Story image gets printed
$values = get_post_custom_values(“Image”); echo $values[0]; ?>” alt=”” id=”leadpic” /><h3>
<?php
// this is where the name of the Lead Story category gets printed
wp_list_categories(‘include=40&title_li=&style=none’); ?></h3>
” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>” class=”title”>
<?php
// this is where the title of the Lead Story gets printed
the_title(); ?>
<?php
// this is where the excerpt of the Lead Story gets printedthe_excerpt(); ?>
{” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”>More»}
<?php endwhile; ?>
</div><!–END FEATURE–><div id=”leftcol”>
<?php
// this is where the Features module begins
query_posts(‘showposts=3&cat=41’); ?>
<h3><?php
// this is where the name of the Features category gets printed
wp_list_categories(‘include=41&title_li=&style=none’); ?></h3>
<?php while (have_posts()) : the_post(); ?>
<div class=”feature”>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><img src=”<?php bloginfo(‘template_url’); ?>/images/<?php
// this is where the custom field prints images for each Feature
$values = get_post_custom_values(“Image”); echo $values[0]; ?>” alt=”” />” rel=”bookmark” class=”title”>
<?php
// this is where title of the Feature gets printed
the_title(); ?>»</div>
<?php endwhile; ?>
</div><!–END LEFTCOL–><div id=”rightcol”>
<?php
// this is where you enter the IDs of which categories you want to display
$display_categories = array(47,43,44);
foreach ($display_categories as $category) { ?>
<div class=”clearfloat”>
<?php query_posts(“showposts=1&cat=$category”);
$wp_query->is_category = false;
$wp_query->is_archive = false;
$wp_query->is_home = true;
?>
<h3>“><?php
// this is where the name of each category gets printed
single_cat_title(); ?></h3>
<?php while (have_posts()) : the_post(); ?>
<?php
// this grabs the image filename
$values = get_post_custom_values(“Image”);
// this checks to see if an image file exists
if (isset($values[0])) {
?>
” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><img src=”<?php bloginfo(‘template_url’); ?>/images/<?php $values = get_post_custom_values(“Image”); echo $values[0]; ?>” alt=”” />
<?php } ?>
” rel=”bookmark” class=”title”><?php
// this is where title of the article gets printed
the_title(); ?>»
<?php the_excerpt(); ?>
<?php endwhile; ?>
</div>
<?php } ?>
</div><!–END RIGHTCOL–>
</div><!–END CONTENT–><?php get_sidebar(); ?>
<?php get_footer(); ?>Thank you all for your help. I am not a programmer but have put my site together myself and this little nit is buggin me.
- The topic ‘Simple Exclude Code’ is closed to new replies.