• I am using the get-the-image plugin for the first time over the past few days after upgrading to 2.9.1.

    What I am trying to do is use get-the-image to work with my timthumb scripts on my current theme.

    What I can’t figure out is how to call get-the-image so that JUST the image url is returned, nothing else, no formatting, no divs, etc…

    How do I do this?

    example:
    img src=......../timthumb.php?src=< if ( function_exists( 'get_the_image' ) ) get_the_image(); >&h=156&w=156&amp

    I had to take out the php part of the code to make sure my code showed up properly, but you get the idea….

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Anointed

    (@anointed)

    For some reason the key ‘echo’ => ‘false’ is not working. I am still ending up with the entire output from get_the_image.

    Does anyone have a ‘filter’ I can run this script through to remove everything but the image url, so that I can pass the url onto timthumb?

    I had a custom mode on this plugin to print the URL of the image but I lost it after I upgraded to 0.4 ??

    I will try to recover it and post it here. It’s a simple but useful feature to add to this plugin. And to the native <?php the_post_thumbnail(); ?>

    i’d also like to see the URL only to get it attached to timthumb. Unfortunately the paid support of the plugin doesn’t even allow a simple request to be made without paying a yearly support fee.

    Probably forking the plugin would be a good idea.

    Unfortunately the paid support of the plugin doesn’t even allow a simple request to be made without paying a yearly support fee.

    Come on. The least you could do is not make misleading statements. There’s several places to make requests without paying for support.

    https://justintadlock.com/archives/2008/05/27/get-the-image-wordpress-plugin
    https://justintadlock.com/contact
    https://themehybrid.com/community/forum/ideas
    https://themehybrid.com/contact
    https://www.ads-software.com/tags/get-the-image?forum_id=10

    Just in case you didn’t notice, none of those cost money. The only cost is the few minutes of time it actually takes to make a request.

    Sorry, i was not trying to make misleading statements i just didn’t notice that these places are accepted for request.

    However i modified the plugin to do what people requested here and sent it over to justin. If anyone would like to use the modified version you’ll find it here: https://drp.ly/t6w3L

    You’ve got to call the function with return_url = true parameter to get the url of the image only. Every other function stays intact so you’ve got to use echo = false if you don’t want the url to get printed directly.

    A next step would probably be to fully integrate timthumb into the plugin but i’ll wait for justins response first. Probably he’s not interested in my modification or further expansion. In this case another solution has to be found.

    Google keeps sending me on a loop here, so I have to repeat the question so many are asking. Is there a way to modify the plugin so we can get it to return the url to the image, or an array. Or, if that is already possible, to have it documented a little better for noobs to understand?

    I’ve taken a look at the code for Get the image, and I’ve found a way to do it. The info seems to be missing from the readme/documentation (for some reason), but the thing to do is:

    //get the info about the image as an array instead of as a finished img tag and store it in a variable, like so
    $get_the_image_as_array = get_the_image( array( ‘image_scan’ => true, ‘format’ => ‘array’, ‘width’ => 220 ) );

    //remove the // on the next line if you want to see what the array contains
    //print_r($get_the_image_as_array);

    //example of things you can output
    echo $get_the_image_as_array[link];
    echo $get_the_image_as_array[url];
    echo $get_the_image_as_array[alt];

    Couldn’t quite figure out the backticks in this forum, so if things are fract here, go to https://pappmaskin.no/2010/03/how-to-make-the-wordpress-plugin-get_the_image-work-with-timthumb/ to see the entire code I now run on my site.

    Thanks for a great plugin by the way!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Get the Image] I need just the url of the image returned’ is closed to new replies.