-
AuthorPosts
-
April 21, 2016 at 2:11 pm #619166
Hey guys,
is there a way to close the preview cirle at the last and first product, so that
at the last product there is a back button to the product before and a forth button to the very first product
as well as
at the first product there is a forth button to the second product and a back button to the very last productBy now there is only a
back button at the last product and a
forth button at the first product.Thank you so much.
Best Stephan
April 25, 2016 at 5:23 am #620980Hey handelsmann!
Thank you for using Enfold.
The issue is a little bit confusing. Please provide a link to the product page in question.
Cheers!
IsmaelApril 25, 2016 at 8:07 am #621051Hey Ismael,
for sure. You see in the last product there is only an arrow to the left side (product before) and you see in the fist product there is only an arrow to the night (next product) but you do not see an arrow on the opposite site.
What I want to have is pointing from the last product to the first product and from the first product to the last product with the mssing arrow.
Thanks for helping out.
Best Stephan
April 27, 2016 at 7:18 am #622787Hi!
Alright. Thank you for the info. Please add this in the functions.php file:
add_filter('avia_post_nav_entries', 'avia_post_nav_entries_mod', 10, 2); function avia_post_nav_entries_mod($entries, $settings) { $first = 1; // id of the first product $last = 2; // id of the last product $first = get_post($first, OBJECT); $last = get_post($last, OBJECT); if(empty($entries['next'])) $entries['next'] = $first; if(empty($entries['prev'])) $entries['prev'] = $last; return $entries; }
Replace the value of the $first variable with the id of the very first product and the $last with the id of the last product.
Regards,
IsmaelApril 27, 2016 at 8:40 am #622848Gangster. This is awesome Ismael. Thank you soooo much for your support.
This works great. Could be an idea for the future to automate this last step by
getting the id of the first and last product which is activated (probably a little bit more tricky).
Awesome.Again – you are great guys. Thanks.
Stephan -
AuthorPosts
- The topic ‘Back and forth – Button – Product Preview’ is closed to new replies.