Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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’);

    #1485852

    Sorry forgot to add credntials

    #1485874

    Hi,

    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,
    Ismael

    #1485916

    No 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

    #1485923

    Hi,

    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,
    Ismael

    #1485972

    Hi 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

    #1485993

    Hi,

    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,
    Ismael

    #1486049

    The 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.

    #1486130

    Hi,

    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.

    View post on imgur.com

    Best regards,
    Ismael

    #1486164

    Hi 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.

    #1486184

    Hi,

    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,
    Ismael

    #1486213

    Missed that enabled products fixed the issue on that one. Thanks for the excellent supprt as always.

    #1486218

    Hi,
    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

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Reverse order of portfolio grid anaimtion’ is closed to new replies.