Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 134500

rkoller on "How to get the link to an image inside the wp-content uploads folder"

$
0
0

Well linking images inside the img folder of a theme is easy. I've done it with:

<img class="testclass" src="<?php bloginfo('template_directory'); ?>/img/test.jpg" alt="test">

But is it somehow possible to also link to an image inside the wp-content uploads folder? I mean is there a similar function like bloginfo('template_directory')?

I would need it for a shortcode. At the moment i am trying out things locally so the shortcode causes an php error:

[resimg src="http://localhost:8888/testsite/bHcNaYxlErtGhM/wp-content/uploads/2014/01/frontpage-4.jpg" caption="Frontpage image"]

if i leave the // of http:// in the rest gets commented out, if i remove http:// a php error is produced due to localhost. Thanks Ralf


Viewing all articles
Browse latest Browse all 134500

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>