Home Forums Front-end Issues Something wrong…


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

    $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–>”;


  • Hi @nicoloaversa

    To reply to your first question. There is an issue with your code.
    Please change:
    $items .= “the_field(‘artist)”;


    $items .= get_field('artist');

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

The topic ‘Something wrong…’ is closed to new replies.