Hi
Masonry shows all blog posts from the selected group. The problem I have is that Masonry also shows the post I am on.
Example: If I am on “Post1” I want Masonry to only show Post2 and Post3. Not “Post1”
Can this be defined?
Thanks
try this in your child-theme functions.php:
function ava_exclude_current_post($query) {
if (is_singular('post') || is_singular('portfolio') ) {
$exclude = avia_get_the_ID();
$query->set( 'post__not_in', array($exclude) );
}
}
add_action('pre_get_posts', 'ava_exclude_current_post');
you can use as if clause instead:
if(is_single()){ …
It works.
nice…
thank you. ;-)
Hi solf,
I’m glad that @Guenni007 could help you :)
Thanks for using Enfold and have a great day!
@Guenni007 thanks for helping out :)
Best regards,
Nikko