Hello,
Just wondering if its possible to exclude the post you are currently on from the recent post listing in the sidebar? I found this, http://wordpress.stackexchange.com/questions/28792/exclude-current-post-from-recent-posts-loop , but have no idea how to apply this. URL to a single post is in the private content, let me know if you need anything else!
Thank you!
Chris
Hi ind-image!
Thank you for using Enfold.
Please try this in the functions.php file:
add_action('pre_get_posts', 'ava_exclude_widget_post');
function ava_exclude_widget_post($query) {
if (!is_admin() && is_singular('post')) {
$exclude = avia_get_the_ID();
$query->set( 'post__not_in', array($exclude) );
}
}
Best regards,
Ismael
Awesome! Works like a charm! Thanks Ismael! This ticket can be closed.