Tagged: Enfold portfolio
Hi,
I’ve set up a new website containing some projects in a portfolio. The next/previous portfolio-item buttons are working fine, except for the last portfolio-item. The next button links to the previous one. Is there a way to link the very first portfolio item instead?
Thanks!
Hey mediabelgium!
That’s pretty weird. By default it should be going by the order in your dashboard. Can you send us a WordPress login so we can take a closer look?
Also be sure to update Enfold to the latest version, 3.0.8, and deactivate all plugins while testing.
Cheers!
Elliott
Hey!
Please add this on functions.php:
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('130', OBJECT);
if(empty($temp_prev)) $entries['next'] = $first;
return $entries;
}
Change the get_post id to the id of the first entry of your portfolio (Group KS).
Cheers!
Ismael
Hi,
Where can I find the id of a portfolio item? I’ve tried to replace the get_post code by “get_post('3472', OBJECT);”, but this doesn’t solve the problem. Most likely I’m doing something wrong here :-)
Hey!
Chose to edit the item in question, then, in your url, you will get something like this: domain.xx/wp-admin/post.php?post=1&action=edit, 1 is the id.
Regards,
Rikard
Hi,
Thanks! Worked like a charm :-)