-
AuthorPosts
-
December 21, 2016 at 6:46 pm #727220
Hello
We have a page that displays all posts from 4 categories: a b c d
When you click a post from Category b – you see that post and on the bottom of the post – a section with a post grid titled “See more from this category b”But we do not want to show the current post that you are on in that slider/grid.
Any ideas?December 22, 2016 at 8:00 am #727424Hey reddishpinkmedia,
Could you post a link to the site in question so that we can take a closer look please?
Best regards,
RikardDecember 22, 2016 at 4:12 pm #727570Sure – you can see a case study in a section called Education.
We have a blog grid below that listing ALL from education. But we don’t want to show the current blog post in that list – doesn’t make sense.
Thanks
JeffDecember 27, 2016 at 10:58 pm #728307Hi Jeff,
Please use Blog Posts element instead of Masonry element and edit the element and set the “Offset Number” to not allow duplicate posts.
Enjoy your holidays!
Best regards,
YigitJanuary 4, 2017 at 8:21 pm #729598Hi there
This didnt seem to work – I set the post grid to not allow duplicate posts on the entire page (set offset automatically)I see the post im on as the first item in the list. Scroll down to -> OTHER CONSTRUCTION PROJECTS YOU MIGHT BE INTERESTED IN
And the first post is the current page.Any ideas?
Thanks!January 6, 2017 at 5:40 am #730166Hi,
Try adding this code in functions.php:
add_filter('avia_masonry_entries_query', 'avia_masonry_custom_query'); function avia_masonry_custom_query( $query ) { global $post; $exclude_ids = array('post__not_in' => array($post->ID)); $query = array_merge((array)$exclude_ids, (array)$query); return $query; }
Let us know if this helps :)
Best regards,
NikkoJanuary 10, 2017 at 2:56 am #731345Hi Nikko
Thanks but I got this error:
Parse error: syntax error, unexpected ‘=’, expecting ‘)’ in /home/frankly/public_html/sib/wp-content/themes/enfold-child/functions.php on line 49January 10, 2017 at 8:44 am #731453Hi,
Try copying the code here: http://pastebin.com/kQrHJ74L if that doesn’t work, can you give us an ftp access to your site? just post the details in the “private content” section.
Cheers!
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.