Support

Account

Home Forums General Issues Url of the image, via query

Unread

Url of the image, via query

  • How do i get via query the url of the image? (Gallery field)

    Ex: I have one SELECT…
    SELECT meta_value FROM wp_".$array_base."_postmeta WHERE post_id = ID AND meta_key = 'single-image') AS image

    
    <?php foreach($wpdb->get_results($resultado_sql, OBJECT) as $rss) { ?>
    <?php
    $imagens = $rss->imagem;
    ?>
    <?php if( $imagens ){ ?>
    <?php foreach( $imagens as $imagem ){ ?>
    <a href="<?php echo $imagem['url']; ?>"><img src="<?php echo $imagem['sizes']['imovelBusca']; ?>" alt="" class="img-responsive" /></a>
    <?php } ?>
    <?php } else { ?>
    <img src="<?php bloginfo('template_directory'); ?>/img/noimage.jpg" class="img-responsive">
    <?php } 
    } ?>
    

    Can anyone understand me? @elliot ?
    Becuse $rss->image; return

    a:23:{i:0;s:2:"77";i:1;s:2:"70";i:2;s:2:"71";i:3;s:2:
    "72";i:4;s:2:"73";i:5;s:2:"74";i:6;s:2:"75";i:7;s:2:
    "76";i:8;s:2:"78";i:9;s:2:"79";i:10;s:2:"80";i:11;s:2:
    "81";i:12;s:2:"82";i:13;s:2:"83";i:14;s:2:"84";i:15;s:2:
    "85";i:16;s:2:"86";i:17;s:2:"87";i:18;s:2:"88";i:19;
    s:2:"89";i:20;s:2:"90";i:21;s:2:"91";i:22;s:2:"92";}
Viewing 1 post (of 1 total)

The topic ‘Url of the image, via query’ is closed to new replies.