Excluding current title and URL in loop - WordPress
A very quick post today but hopefully this will help a few people.
WordPress is a great tool for a small website requiring regular editing. While using the loop i wanted to find a way to exclude the current pages url from a list of links. There is no point in a page linking to itself!
By using the the post__not_in function its easy to do.
<?php query_posts(array('showposts'=> 6,'post__not_in' => array($post->ID)));
while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php endwhile;?>
Did it work? Any problems? Post a comment below.
Comments
The loans seem to be important for people, which want to ground their career. By the way, that’s easy to receive a consolidation loan.
By Tami18Gay on 24th March 2012Every american history essays firm must hire singly academic specialists. students naturally are going to order the highest quality college essays and it’s normal.
By SusieWheeler25 on 30th March 2012
http://promgazarm.ru , , , -1, -2 http://promgazarm.ru/tags/ 1127, -50, ,
By 7qu35r0d on 21st February 2012