
-
AuthorPosts
-
June 24, 2025 at 8:23 pm #1485850
I find the side arrows for the navigation are working in reverse order here:
https://anthonyi34.sg-host.com/portfolio-item/boulder-garden/
I don;t need them to loop but te order is reveresd.
I see this in my chid themes functions php now, how can i get the order to be correct? thanks:
<?php
/*
* Add your own functions here. You can also copy some of the theme functions into this file.
* WordPress will use those functions instead of the original functions then.
*/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;
}function remove_title_attr(){
?>
<script>
jQuery(window).load(function(){
jQuery(‘#wrap_all a’).removeAttr(‘title’);
jQuery(‘#wrap_all img’).removeAttr(‘title’);
});
</script>
<?php
}
add_action(‘wp_footer’, ‘remove_title_attr’);June 24, 2025 at 8:33 pm #1485852Sorry forgot to add credntials
June 25, 2025 at 6:48 am #1485874Hi,
Thank you for the inquiry.
Try to remove this part from the avia_post_nav_entries filter.
$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’]);
Let us know if this makes any difference.
Best regards,
IsmaelJune 25, 2025 at 11:45 pm #1485916No I dleeted thos elines in the chld theme functions php and it had no effect. Also we need the nav to stay witjin the same taxonomy. While it does that generally speaking when you get to the end of the projects it then shows all the staff ebtires which are also portfolio items in another catagory. Can we remedy that as well? It looks to me like the code was ser up to do that,but i Gather it didn’t.
Thanks so much
June 26, 2025 at 7:11 am #1485923Hi,
Thank you for the update.
Try to replace the whole filter with the following code:
add_filter('avf_post_nav_entries', 'avf_post_nav_entries_mod', 10, 2); function avf_post_nav_entries_mod($entries, $settings) { if ($settings['type'] == 'portfolio') { $settings['same_category'] = true; // swap prev and next $entries['next'] = get_previous_post($settings['same_category'], $settings['excluded_terms'], $settings['taxonomy']); $entries['prev'] = get_next_post($settings['same_category'], $settings['excluded_terms'], $settings['taxonomy']); } return $entries; }
when you get to the end of the projects it then shows all the staff
Also, make sure that the portfolio items don’t share even a single category, otherwise, they will be included in the navigation.
Best regards,
IsmaelJune 26, 2025 at 7:30 pm #1485972Hi Ismael,
Puting in that code instead had no effect. I out ut back to the way it was for now. Ay other ideas? Also is there a way to keep the nav in the same taxonomy so the staff and rojects are seperate, so when you get to the end of the projects it doesn;t go to staff and vice-versa?
Thanks
June 27, 2025 at 7:35 am #1485993Hi,
We edited the code a bit and replaced avia_post_nav_entries with avf_post_nav_entries. Please try it again.
staff and projects are seperate
As mentioned above, you need to make sure that the items do not share the same category. If the items in the staff and projects taxonomies share even a single category or term, they will be included in the navigation.
Best regards,
IsmaelJune 27, 2025 at 6:37 pm #1486049The nav is still reversed. Look at. the first one on the prjects, just one arrow as we dont have it looped which is correct, but its on the left side whic indicates going backwards. All the others have the two arrows, but again the left goes forward and the right goes backwards. And the kast one sill goes thru tot he staff. None of the categoires macth between staff anf project portfolio ites.
June 30, 2025 at 6:43 am #1486130Hi,
We updated the functions.php file. Here’s a screenshot of the “colliers” item, showing “montgomery-and-aldridge-2” on the left navigation and “burns-mcdonal” on the right.
Best regards,
IsmaelJune 30, 2025 at 6:10 pm #1486164Hi Ismael,
That seems to work except in the case of the one you pointed pointed out Colliers should go back one step to The Bouder Garden not two to Montgomery and Aldridge. Montgomery and Aldrirge skiped over The Boulder Garden. It occurs to the grid is ordered using the Post Type order plugin. If I disable this plugin the nav malfunctions all over the place and runs backwards again. However I have that plugin on a different site and the nav worked there so not sure what to do.
July 1, 2025 at 5:38 am #1486184Hi,
The Boulder Garden doesn’t belong in the same category (Corporate Interiors, Projects) as Colliers and the other two portfolio items, so it’s excluded. If you want to prevent this, you can remove this line.
$settings['same_category'] = true;
Unfortunately, the Post Type Order plugin is not compatible with the post navigation and actually breaks the query for some reason. We recommend disabling the plugin or contact the plugin developer for additional assistance.
Best regards,
IsmaelJuly 1, 2025 at 6:56 pm #1486213Missed that enabled products fixed the issue on that one. Thanks for the excellent supprt as always.
July 1, 2025 at 10:40 pm #1486218Hi,
Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Reverse order of portfolio grid anaimtion’ is closed to new replies.