Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #417741

    Hi,
    A while ago, I was looking for a solution on the portfolio navigation (#390736 – the ‘next button’ of the last entry pointed to the previous entry instead of the very first entry).
    The problem was solved by adding code to the functions.php file. The next/previous buttons are doing their job, but in the footer of the website, some code about the previous portfolio item is shown.
    You can see an example on http://mediabelgium.be/projecten/cook-experience/

    #417769

    Hi mediabelgium!

    What kind of changes have you made prior to this issue? Have you edited any other theme files?

    Regards,
    Yigit

    #418617

    Hi,
    I’m working with a child theme, and the only php files that are edited are functions.php and footer.php
    the functions file contains the code for solving the problem with the first/next button on the last portfolio-item. I’ve noticed a small change in the footer.php file as well:
    <?php
    //display link to previeous and next portfolio entry
    echo avia_post_nav();

    echo “<!– end wrap_all –></div>”;
    “echo avia_post_nav();” is added to the code. If I comment out this line, the code in the footer disappeares and the footer looks normal again, but the next/previous buttons disappear as well. So I guess the problem should be situated here.
    Regards,
    Media Belgium

    #419562

    Hey!

    you are using an old version of the theme. Please update to Enfold v3.1.2. Let us now if this helps.

    Cheers!
    Andy

    #421070

    Hi,

    I’ve updated the theme to 3.1.3 and still the problem occurs.

    Regards,

    Media Belgium

    #421862

    Hi!

    What happens when you delete the footer.php file? Is this the code in the functions.php file?

    add_filter('avia_post_nav_entries', 'avia_apply_custom_sort_order_to_post_nav', 10, 2);
    function avia_apply_custom_sort_order_to_post_nav($entries, $settings)
    {
        $temp_prev = $entries['prev'];
        $temp_next = $entries['next'];
        $entries['prev'] = $entries['next'] = "";
        if(!empty($temp_prev)) $entries['next'] = $temp_prev;
        if(!empty($temp_next)) $entries['prev'] = $temp_next;
    	$first = get_post('83', OBJECT);
    	if(empty($temp_prev)) $entries['next'] = $first;
        return $entries;
    }

    Best regards,
    Ismael

    #421919

    Hi,

    Thanks for posting the code, I’ve compared it with the code I have in the functions.php file, and I’ve found a small difference. This line of code was causing the problem:
    var_dump($temp_next);

    Thanks for the help!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Portfolio navigation – solution caused extra problem’ is closed to new replies.