• Hello,

    I am adding a link to an external site and want to associate an image with that link. Under advanced, if I specify a local address, it automatically appends and http:// and does not work.

    I am looking for a way around hard coding the image url if possible.

    Is there a way to grab the current theme’s dir? like %THEME_URL%/myimage.png or something like that I could use in address of the link?

Viewing 5 replies - 1 through 5 (of 5 total)
  • If “local” means your computer, it is impossible to do that.
    You have to upload your picture to your web server, the easiest way is Media Library (WP-admin > Media > Add New). Then get the picture path and use it.

    Thread Starter mooreaa

    (@mooreaa)

    Hi Zeally, I mean local to the server. I have some images in the /images folder of my custom theme, and I want my links to use those icons. Right now I have a really ugly url hard coded for mysite.com/blog/wp-content/themes/mytheme/images/myimage.jpg

    Let’s try this

    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/abc.jpg">

    More Info

    Thread Starter mooreaa

    (@mooreaa)

    Hi zeally,

    I’ve done that within my templates to reference the stylesheets dir, but i am trying to do this from the wordpress control panel where i am adding a link to my side bar.

    The link system that is built in allows me to reference a url, but it doesn’t let me reference a local path or so it seems. Maybe this is a limitation of the software.

    I think you want to add credit link & image to your published theme.
    May be you have to use pre_link_image filter.

    http://codex.wordpress.org/Plugin_API/Filter_Reference#Blogroll_Filters

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to reference local blog address for link images’ is closed to new replies.