Hello,
Please take a look at this post:
https://kriesi.at/support/topic/read-more-button-in-the-overlay-masonry/
I’m using this code for the ‘read more’ link at the portfolio items.
Can I use a Advanced custom field before this excerpt?
I’ve altered the code to this:
//Read more masonry
add_filter(‘avf_masonry_loop_prepare’,’avia_change_default_link’, 10, 2);
function avia_change_default_link($loop, $entries)
{
foreach($entries->posts as $key => $entry)
{
if($entry->post_type == “portfolio”)
{
$klantnaam = get_field(‘klantnaam’);
$more = “<br /><span class=’masonry-more-link-arrow’>”.$klantnaam.” | Bekijk project</span>”;
$loop[‘content’] = avia_backend_truncate($entry->post_content, apply_filters( ‘avf_masonry_excerpt_length’ , 60) , apply_filters( ‘avf_masonry_excerpt_delimiter’ , ” “), “…”, true, ”) . $more;
}
}
return $loop;
}
Where ‘klantnaam’ is the advanced custom field.
Greets Jeen
Hey Jeen,
Have you tried the code? Try changing the double and single quotes:
‘ to ' and “ to "
Let us know how that worked.
Best regards,
Victoria
Hello Victoria,
Thanks for the quick reply and sorry for my late answer.
I’ve got it working all right.
Greets Jeen