• Resolved Abdelhadi Touil

    (@hadi060)


    Hi.
    Thanks for this great plugin, I use it in all my themes now.
    I was looking for a parameter to get the full url image, but I didn’t find it, so can you add it please in the next version?
    I mean I want a way to make the plugin retrive the full image url to use it in some situations, like in a slider for example.
    Thanks.

    https://www.ads-software.com/extend/plugins/get-the-image/

Viewing 2 replies - 1 through 2 (of 2 total)
  • miguelesquirol

    (@miguelesquirol)

    After fighting like crazy I finally managed to hack something together… I couldn’t touch the plugins files or the function file (and I′m not really good at PHP). BUt I managed to strip everything from the code that get_the_image gives you and leave the actual image URL.

    What I wanted to do here is to have a direct link to the image (instead of a link to the page where the image is). I’m sure there are better methods but this is mine.

    <?php
    $text =  get_the_image( array( 'custom_key' => array( 'thumbnail' ), 'echo' => false, 'link_to_post' => false,'size' => 'full') ); ;
    preg_match_all('/\b(([\w-]+:\/\/?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/)))/',$text,$matches);
    $matches = $matches[1];
    $list = array();
    
    foreach($matches as $var)
    {
       print("<a href='".$var."' rel='lightbox'>");
    }
    ?>
    	    <li class="post-<?php the_ID(); ?> thumb-big"><?php get_the_image( array( 'custom_key' => array( 'thumbnail' ),  'link_to_post' => false,'default_size' => '320x320',  'width' => '320', 'height' => '320' ) ); ?></li></a>
    Thread Starter Abdelhadi Touil

    (@hadi060)

    Thanks for you reply miguelesquirol, I’ll try to choose what I want from your code and try it.
    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get the full image url parameter?’ is closed to new replies.