Exclude Current Post in list
-
Hi
Wonder if someone can help me with modifying my code;I have a page displaying a single post and a list of all posts in the sidebar, an include on the page;
Can someone show me how to modify my code to exclude the current single post from the list of all posts; Heres the code displaying all the posts;
<div id=”column”>
<div class=”blog”>
<?php query_posts(‘cat=1’); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”latestNews”> <span class=”img”>
<?php $thereisimage = get_post_meta($post->ID, thumbnail, true);
if($thereisimage){ ?>
<img src=”<?php echo get_post_meta($post->ID, thumbnail, true); ?>” alt=”<?php the_title(); ?>”/>
<?php }else{ ?>
<?php } ?>
</span>” title=”<?php the_title(); ?>” rel=”bookmark”><?php echo short_title(‘…’, 40); ?>
<?php echo short_content(‘…’, 54); ?></div>
<?php endwhile; endif; ?>
</div>
<div id=”newsletter”><span class=”Newslettertitle”>Our Newsletter NEEW</span>
To receive updates from Stiwdio, submit your details in the fields below.
<form id=”contactForm” action=”http://email.stiwdio.com/t/r/s/ndlhlr/” method=”post”/>
<input type=”text” name=”cm-ndlhlr-ndlhlr” value=”Email” class=”email” id=”ndlhlr-ndlhlr”/>
<input type=”text” name=”cm-name” value=”Name” class=”fullname” id=”name”/>
<input type=”submit” value=”Subscribe” class=”submit”/>
</div>
<script type=”text/javascript” src=”../assets/js/loadScript.js”></script></div>
The topic ‘Exclude Current Post in list’ is closed to new replies.