-
AuthorPosts
-
December 16, 2018 at 7:22 am #1045810
All entires in the portfolio grid have navigational arrows to go to the next portfolio page, but they run backwards.
On another installation I had added this to the child themes functions php to solve this:
add_filter( ‘avia_post_nav_entries’, ‘enfold_customization_postnav’, 10, 2);
function enfold_customization_postnav($entries, $settings)
{
if($settings[‘type’] == ‘portfolio’)
{
$settings[‘same_category’] = true;$entries[‘prev’] = get_previous_post($settings[‘same_category’], $settings[‘excluded_terms’], $settings[‘taxonomy’]);
$entries[‘next’] = get_next_post($settings[‘same_category’], $settings[‘excluded_terms’], $settings[‘taxonomy’]);
}return $entries;
}Same type of installation it worked elsewhere but not in this case on this new installation. How can I correct this?
Thanks so much.
December 16, 2018 at 3:57 pm #1045927Hey tonyiatridis,
The code above only says the nav to remain in the same category, it does not affect the sort order.
Your solution should be something like this
https://kriesi.at/support/topic/portfolio-order-reversed/#post-400533If you need further assistance please let us know.
Best regards,
VictoriaApril 27, 2019 at 3:19 pm #1094911the filter name has changed on 4.5.6 ( avia – is deprected ):
add_filter( 'avf_post_nav_entries', 'enfold_change_direction_postnav', 10, 2); function enfold_change_direction_postnav($entries, $settings) { $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; }
if you like it only for portfolio you can edit your code above with the new filter name.
April 28, 2019 at 6:34 pm #1095069New – better Solution for it since 4.5.6:
https://kriesi.at/support/topic/is-it-possible-to-loop-the-post-navigation/#post-1094924April 29, 2019 at 7:14 pm #1095443Hi tonyiatridis,
Did you get it working?
@Guenni007 thank you for your input.Best regards,
VictoriaApril 30, 2019 at 2:30 am #1095557Ironically, we decided to set the portfolio grid to load randomly as it’s a selection of authors and as the site grows we don’t want certain authors to always be on page 2 of the grid. However, I believe I had the same issue on another Enfold installation, and I’ll check there and follow up. Thanks for the help.
May 1, 2019 at 5:53 am #1096018 -
AuthorPosts
- You must be logged in to reply to this topic.