Tagged: , , ,

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

    Hi there,

    Can you guys help me on this? i’m stuck.
    I installed the ACL ( advanced custom fields) plugin and created a custom field “news_origin” and want to add to the postslider.php just after the excerpt.
    i added this piece of code:

    $output .= “<img src=’ “;
    $image = the_field(“news_origin”);
    $output .= $image[‘url’];
    $output .= ” ‘ alt=’ ‘ />”;

    but the result is
    Is not applying the image url.

    Can you help
    Thanks.

    #1101529

    Hey Kyle,

    Instead of using

    the_field(“news_origin”);

    try using:

    get_field("news_origin");

    Hope it helps.

    Best regards,
    Nikko

    #1102510

    Hi Nikko,

    After a great search, i found this on a old post in the enfold forum. And it worked. So i just add it here if someone needs it also.

    $output .= "<div class='news_origin_image'><img src='";
    $output .= get_field('news_origin', $entry->ID);
    $output .= "'></div>";

    Cheers

    #1102584

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘advanced custom fields and the image url’ is closed to new replies.