Support » Plugin: Advanced Custom Fields » Image don’t View

  • Resolved alessio17pa

    (@alessio17pa)


    I created a custom field, named bg_article_home.
    I applied a rule that says this post must show when post taxonomy equals in_evidence.
    Then I went into the article and uploaded an image.
    In the backend I have tried all the documentation code but I don’t understand what I’m doing wrong.
    The code I have now put:

    `<!– Pre-Article Home –>
    <section class=”mt-5″ id=”pre-article-home”>

    <div class=”container pre_article_home_container”>
    <div class=”row align-items-center”>

    <?php

    $args = array(
    ‘post_type’ => ‘post’,
    ‘tag’ => ‘in_evidenza’,
    ‘posts_per_page’ => 1
    );

    // The Query
    $kaos_home_news_tag = new WP_Query( $args );

    //The loop
    while ($kaos_home_news_tag->have_posts() ) : $kaos_home_news_tag->the_post();

    ?>

    <div class=”col-4 pre_article_home_container-left “>
    <h6> <?php the_category(); ?> </p>
    <h4> <?php the_title(); ?> </h4>
    ” class=”text_continua”>Continua
    </div>

    <div class=”col-8 pre_article_home_container-right “>
    <div class=”bg_right”>

    ” alt=””>

    </div>
    <div class=”img_right”>
    <?php the_post_thumbnail( ‘kaos_big’, array(‘class’ => ‘img-fluid’, ‘alt’ => get_the_title()) ) ?>
    </div>
    </div>

    <?php

    endwhile;

    wp_reset_query();
    wp_reset_postdata();

    ?>

    </div>

    </div>

    </section>
    <!– END-Pre-Article Home –>’

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @alessio17pa,

    I can see some HTML/PHP problems in your code.


    <h4> <?php the_title(); ?> </h4>
    �? class=�?text_continua�?>Continua
    </div>

    The second line seems it’s not correct, that the open <div> is missing.


    <div class=�?bg_right�?>
    �? alt=�?�?>
    </div>

    Here it seems that the HTML for the image it’s not complete

    There is HTML code missing, one of that code is the image HTML code. Take a look at it.

    Once the HTML is fixed, and if the image doesn’t appear, tell us.

    Thread Starter alessio17pa

    (@alessio17pa)

    Thank you very much, i solved. Sometimes (very often) I forget the closures.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Image don’t View’ is closed to new replies.