Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #800094

    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

    #800255

    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

    #800817

    Hello Victoria,

    Thanks for the quick reply and sorry for my late answer.
    I’ve got it working all right.

    Greets Jeen

    #800914

    Hi,

    Great, glad you got it working and thanks for letting us know. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

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