-
AuthorPosts
-
March 25, 2015 at 2:29 pm #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/March 25, 2015 at 3:11 pm #417769Hi mediabelgium!
What kind of changes have you made prior to this issue? Have you edited any other theme files?
Regards,
YigitMarch 26, 2015 at 5:01 pm #418617Hi,
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 BelgiumMarch 27, 2015 at 7:09 pm #419562Hey!
you are using an old version of the theme. Please update to Enfold v3.1.2. Let us now if this helps.
Cheers!
AndyMarch 31, 2015 at 12:39 pm #421070Hi,
I’ve updated the theme to 3.1.3 and still the problem occurs.
Regards,
Media Belgium
April 1, 2015 at 1:35 pm #421862Hi!
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,
IsmaelApril 1, 2015 at 2:56 pm #421919Hi,
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!
-
AuthorPosts
- The topic ‘Portfolio navigation – solution caused extra problem’ is closed to new replies.