-
AuthorPosts
-
August 9, 2017 at 9:10 am #836237
Hi,
On a single portfolio item page, I also have the portfolio grid showing related portfolio items. However, it pulls the same portfolio item that I’m currently on. This problem was brought up already in this post – https://kriesi.at/support/topic/remove-current-portfolio-post-from-related-portfolio-grid-enfold/. However the solution specified in the post doesn’t work – it simply seems to be removing the first portfolio item from the grid regardless of which portfolio item I’m on.
This is what I tried, according to the post mentioned above –function ava_exclude_portfolio($query) { if (is_singular('portfolio')) { $query->set( 'offset', '1' ); } } add_action('pre_get_posts', 'ava_exclude_portfolio');
Pls let me know if I’m missing anything here?
August 10, 2017 at 11:32 am #836906Hey eric-kfa,
Here is the code you can put in your funtions.php
/*filter portfolio sorting */ add_filter('avia_post_grid_query', 'avf_custom_post_grid_query'); function avf_custom_post_grid_query ( $query ) { if(is_singular('portfolio')) { global $post; $query['post__not_in'] = array($post->id); } return $query; }
If you need further assistance please let us know.
Best regards,
VictoriaAugust 11, 2017 at 7:59 am #837335Hi Victoria,
This still doesn’t work. It shows me the same portfolio item in the grid as the one I’m currently on.
Could you please take a look?August 12, 2017 at 10:12 pm #838049Hi eric-kfa,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
It show different items to me. Look in private.Best regards,
VictoriaAugust 13, 2017 at 9:13 am #838180Sorry, it looks different because I added more posts. The portfolio grid always picks up the latest posts, so since I added newer ones, it shows newer items. So now for instance you can see the repeat happening for the link I shared below.
Also sharing the temp access for our server.August 14, 2017 at 7:02 pm #838877Hi, any updates?
August 15, 2017 at 1:40 pm #839272Hi eric-kfa,
The code above does not work, because those are not portfolios, those are teachings “single single-teaching”.
Can you give that account admin rights? Is that a plugin?Best regards,
VictoriaOctober 31, 2018 at 7:47 pm #1028592Just tried this code…can confirm it does not work.
-
AuthorPosts
- You must be logged in to reply to this topic.