WordPress.org

Ready to get started?Download WordPress

Forums

How do I link to an image with PHP code? (2 posts)

  1. vbcruiser
    Member
    Posted 5 years ago #

    I've made a hover button for my feedburner RSS in my header and works fine as I have it linking directly on my URL.

    I want to re-distribute my theme, so I need to reference that hover button to the URL that the theme will be used on. What code do I use to do this? Here is the hover button code, that works on my site:

    <div id="headerright">
    
    <input type="hidden" value="<?php $feedburner_id = get_option('revlifestyle_feedburner_id'); echo $feedburner_id; ?>" name="http://feeds2.feedburner.com/"/>
    
    <a href="<?php bloginfo('rss_url'); ?>"
    
    onmouseover="image1.src='http://www.mysite.com/wp-content/themes/mytheme/images/rss-hov-maroon.png';"
    onmouseout="image1.src='http://www.mysite.com/wp-content/themes/mytheme/images/rss-maroon.png';">
    <img name="image1" src="http://www.mysite.com/wp-content/themes/mytheme/images/rss-maroon.png" border=0></a> border=0></a>
    
    	</div>
  2. Monkeyboy
    Member
    Posted 5 years ago #

    I think this would do it...

    <?php bloginfo('template_directory'); ?>

    So for your image source you would have something like...

    <?php bloginfo('template_directory'); ?>/images/rss-hov-maroon.png

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags