use Img source with php variable

后端 未结 2 844
走了就别回头了
走了就别回头了 2021-01-25 16:36

I want to use some thumbshots generated images inside a WP loop, and the code looks like this:

if (!$thumbnail && wpbdp_get_option(\'use-default-picture\         


        
相关标签:
2条回答
  • 2021-01-25 17:04
    $thumbnail = 'http://images.thumbshots.com/image.aspx?cid=HIPFHapOLHw%3d&v=1&w=283&url='.urlencode(wpbusdirman_the_listing_meta('single'));
    
    0 讨论(0)
  • 2021-01-25 17:06

    URL encode the returned value!! You're putting a URL into a URL- if you don't URLEncode it, you're asking for more than a little trouble. I believe it's as simple as:

    <?php echo urlencode(wpbusdirman_the_listing_meta('single')); ?>
    

    :)

    0 讨论(0)
提交回复
热议问题