Thursday, August 18th, 2016
Tags: Functions, Name, Query, Tax, Taxonomy, Term, Terms, WordPress
Posted in PHP, WordPress | No Comments »
Wednesday, August 17th, 2016
Get the current page ID and use that in the WordPress query to exclude that post from displaying.
<?php $currentID = get_the_ID();?>
<?php $args = array(
'post_type' => 'post',
'post__not_in' => array($currentID)
);
$query = new WP_Query($args);
$i = 1;
while ( $query->have_posts() ) : $query-> the_post(); ?>
Tags: Current ID, Exclude, PHP, Post__not_in, WordPress
Posted in PHP, WordPress | No Comments »