Tagged: masonry, navigation, Portfolio
-
AuthorPosts
-
October 1, 2020 at 11:07 am #1249842
Hi, I am using Enfold and I really like it.
I would like to ask you if possible reverse the order of portfolio items in masonry portfolio grid.
I explain better: I set the mansonry portfolio and when I open a project there are two navigation arrows on both side and If I click on right arrow I go to previous project and If I click on left arrow I go to next project. Is it possible to reverse the order so clicking on right I go to next project and clicking on left I go to previous project? I am using Post Types Order plugin.
Here the link to the website: http://www.francogaffuri.com
Thank you very much*** Currently, waiting for your reply, I temporarily deactivated the arrows using the following CSS: #top .avia-post-nav { display: none; }
- This topic was modified 4 years, 1 month ago by argentinadelfina.
October 5, 2020 at 12:04 pm #1250569Hey argentinadelfina,
Thank you for the inquiry.
Yes, reversing the post navigation is possible. We could use this snippet or filter in the functions.php file to assign the value of the next arrow to the previous arrow and vice versa.
add_filter( 'avia_post_nav_entries', 'avia_post_nav_entries_mod_reverse', 10, 2); function avia_post_nav_entries_mod_reverse($entries, $settings) { if($settings['type'] == 'portfolio') { $settings['same_category'] = true; $entries['prev'] = get_next_post($settings['same_category'], $settings['excluded_terms'], $settings['taxonomy']); $entries['next'] = get_previous_post($settings['same_category'], $settings['excluded_terms'], $settings['taxonomy']); } return $entries; }
Best regards,
IsmaelOctober 5, 2020 at 12:30 pm #1250578Hi thank you for your reply.
I pasted the filter and it works, but i need to show the next and previous project as in the portfolio order, currently it shows in the next and previos the same category.
Thank you very muchOctober 6, 2020 at 12:25 pm #1250828Hi,
Thank you for the inquiry.
What happens when you set the same_category parameter to false, or this line.
$settings['same_category'] = true;
Please try to set it to false.
Best regards,
IsmaelOctober 6, 2020 at 2:20 pm #1250851Hi Ismael thank you very much for your reply.
It works and is what I needed.
Thank youOctober 6, 2020 at 9:22 pm #1250966Hi argentinadelfina,
Glad we could help :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.