Answers for "wordpress remove current post in sidebar php"

PHP
0

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; ?>
Posted by: Guest on December-05-2020

Code answers related to "wordpress remove current post in sidebar php"

Browse Popular Code Answers by Language