Support

Account

Home Forums Front-end Issues image not displaying in the_content()

Solving

image not displaying in the_content()

  • I want to display the image that i have uploaded using acf in particular post whose category is catalogue the image is showing in post but when i want to
    display all the post content including that image on page named catalogue
    the_content() only displays the content of post but not the image that i have uploaded in the post whose category name is catalogue.
    <?php
    $category_id = get_cat_ID(‘catalogue’);
    $args = array( ‘posts_per_page’ => 8,’category’ => 3 );
    $myposts = get_posts( $args );

    foreach( $myposts as $post ) : setup_postdata($post);
    //print_r($post);
    $id=$post->ID
    ?>

    <?php
    the_content();
    endforeach;
    ?>

  • Sorry @yasir.shinedezign, is not clear what you say…

    Please check this page http://www.advancedcustomfields.com/resources/field-types/image/ for documentation on how to get a value from a file/image field.

Viewing 2 posts - 1 through 2 (of 2 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.