Support

Account

Home Forums General Issues How can I get the image that does not have upload

Solving

How can I get the image that does not have upload

  • I’m trying to say when there is a picture coming a default but my start double..
    And when I say double, it means I’ve added a picture in another post and bottom has default noimage.

    My Code:

    <?php if (get_field('sale_parking_11')): ?>
    <img src="<?php the_field('sale_parking_11'); ?>" style="height: 150px"> 
    <?php else : ?>
    <img src="images/nophoto.jpg" style="height: 150px"> 
    <?php endif; ?>

    Please help me!!

  • There isn’t enough information here to figure out what might be wrong with what your doing. From just this it appears that it should be working. Can you provide additional code. Not sure I need the entire template but seeing the loop might help.

  • I try to create a realestate and i pull data through category.php and single.php..I don’t want to create separate custom files templates, because after i have a problem with the selection category.

    Thank you very much for support!

  • Sorry for the delay in responding. Been having a bit of an issue getting notifications that I just recently noticed.

    I’m still not really sure what it is that you’re looking for.

    The code you originally posted can only show one image.

    <?php if (get_field('sale_parking_11')): ?>

    can only be true or false and that means the either the if or the else is executed. If you are seeing another image then that other image must be output by different code.

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

You must be logged in to reply to this topic.