Support

Account

Home Forums Front-end Issues Something wrong…

Solved

Something wrong…

  • Hi! i’m not an expert.. what’s is wrong with this part of code?
    I put in bold the slug of the field i need to display..

    $items .= “<div class=’av-masonry-entry-content entry-content’>”;
    $items .= “the_field(‘artist)”;
    $items .= “</div>”;

    I need also to add a conditional statements for this field!

    Any suggestions!?

  • Looks like you are missing the closing single quote on ‘artist’

  • sorry, that’s not works anyway…

  • try this in 1 line

    <?php
    $items = “<div class=\”av-masonry-entry-content entry-content\”>”.the_field(‘artist’);”</div>”;
    ?>

  • nothing…

    i show u the complete part of code.. i would to replace the part in bold (&content) with 3 custom field i’ve insert for a portfolio item..

    //title and excerpt
    if($this->atts[‘caption_elements’] != ‘none’ || !empty($text_add))
    {
    $items .= “<figcaption class=’av-inner-masonry-content site-background’><div class=’av-inner-masonry-content-pos’><div class=’avia-arrow’></div>”.$text_before;

    if(strpos($this->atts[‘caption_elements’], ‘title’) !== false){
    $items .= “<h3 class=’av-masonry-entry-title entry-title’>{$the_title}</h3>”;
    }

    if(strpos($this->atts[‘caption_elements’], ‘excerpt’) !== false && !empty($content)){
    $items .= “<div class=’av-masonry-entry-content entry-content’>{$content}</div>”;
    }

    $items .= $text_after.”</div></figcaption>”;
    }
    $items .= “</figure>”;
    $items .= “</{$html_tags[1]}><!–end av-masonry entry–>”;
    }

    thx!

    • Elliot

    • February 17, 2014 at 9:44 am

    Hi @nicoloaversa

    To reply to your first question. There is an issue with your code.
    Please change:
    $items .= โ€œthe_field(โ€˜artist)โ€;

    to

    $items .= get_field('artist');

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.