Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress remove current post in sidebar php

<?php
$currentID = get_the_ID();
$my_query = new WP_Query( array('cat' => '1', 'showposts' => '5', 'post__not_in' => array($currentID)));
while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title() ?></a></h2>
<?php the_content(); ?>
<?php endwhile; ?>
Source by www.daretothink.co.uk #
 
PREVIOUS NEXT
Tagged: #wordpress #remove #current #post #sidebar #php
ADD COMMENT
Topic
Name
5+7 =