Viewing 5 posts - 1 through 5 (of 5 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('avia_post_nav_entries', 'enfold_customization_postnav', 10, 2);
    
    function enfold_customization_postnav($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

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.