WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Make image links work in sidebar (5 posts)

  1. Jay Pegg
    Member
    Posted 5 years ago #

    Hello - I am playing with the Newsweek Theme from PremiumThemes. I'm not especially code savvy and a bit of a WP newbie.

    You can see the site currently here: http://www.viralweek.com

    I am having some trouble trying to get sidebar images to link externally. I will paste the code below. Could someone advise how I would make all the sponsor .pngs at the end of the code link?

    I have tried copying the method used successfully half way down the sidebar (From our partners image) but this upsets the page, making everything below link as well and running into the footer. I'm guessing i need to close something? Where should I put the link code?

    Thanks in advance for your support.

    <div id="sidebar_r">
    
    <div class="subscribe">
    	<h2 class="sidebartitle">
          <?php _e('Stay in touch'); ?>
        </h2>
    	 <p class="i_twitter"><strong ><a href="http://www.twitter.com/">Twitter</a></strong></p><p class="i_facebook"><strong ><a href="http://apps.new.facebook.com/viralweek/">On Facebook</a></strong></p><p class="i_rss"><strong ><a href="feed:<?php bloginfo('rss2_url'); ?>">Subscribe via RSS</a></strong></p>
      <p class="i_email"><strong >Subscribe via email</strong></p>
       <div class="subscribetextbg">
        <form action="http://www.feedburner.com/fb/a/emailverify" method="post" target="popupwindow" onsubmit="window.open('http://www.feedburner.com/fb/a/emailverifySubmit?feedId= Your Feed ID here ', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
          <input name="email" type="text" value="Your email address" class="subscribe_textield" onfocus="if (this.value == 'Your Email Address') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Your Email Address';}" />
          <br />
          <input type="hidden" value="http://feeds.feedburner.com/~e?ffid= Your Feed ID here " name="url"/>
          <input type="hidden" value="<?php bloginfo('name'); ?>" name="title"/>
          <input type="hidden" name="loc" value="en_US"/>
          <input type="image" src="<?php bloginfo('template_url'); ?>/images/b_subscribe.png"  class="subscribe_b"  value="Subscribe"  />
        </form>
      </div>
    </div>
    
    <div class="advt">
     <h2 class="sidebartitle">
          <?php _e('From our Partners'); ?>
        </h2>
    <a href="http://www.nike.com"><img src="<?php bloginfo('template_url'); ?>/images/advt_300x250.jpg" alt=""  />
    
    </div>
    
    <?php include (TEMPLATEPATH . "/tabber.php"); ?>
    
    <ul>
        <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : ?>
       <li>
          <h2 class="sidebartitle">
            <?php _e('Other good things'); ?>
          </h2>
          <ul class="list-blogroll">
            <?php get_links('-1', '<li>', '</li>', '<br />', FALSE, 'id', FALSE, FALSE, -1, FALSE); ?>
          </ul>
        </li>
        <?php endif; ?>
      </ul>
    
    <div class="sponsorslist" >
    <h2 class="sidebartitle">
          <?php _e('Friends & Family'); ?>
        </h2>
        <ul class="sponsors" >
        <li><img src="<?php bloginfo('template_url'); ?>/images/s1.png" alt=""  /></li>
          <li><img src="<?php bloginfo('template_url'); ?>/images/s2.png" alt=""  /></li>
          <li><img src="<?php bloginfo('template_url'); ?>/images/s3.png" alt=""  /></li>
           <li><img src="<?php bloginfo('template_url'); ?>/images/s4.png" alt=""  /></li>
           <li><img src="<?php bloginfo('template_url'); ?>/images/s5.png" alt=""  /></li>
           <li><img src="<?php bloginfo('template_url'); ?>/images/s6.png" alt=""  /></li>
           <li><img src="<?php bloginfo('template_url'); ?>/images/s7.png" alt=""  /></li>
            <li><img src="<?php bloginfo('template_url'); ?>/images/s8.png" alt=""  /></li>
             <li><img src="<?php bloginfo('template_url'); ?>/images/s9.png" alt=""  /></li>
            </ul>   
    
    </div>
    
    <div class="advt">
    <img src="<?php bloginfo('template_url'); ?>/images/advt_300x100.gif" alt=""  />
    
    </div>
    
    </div>
    <!--/sidebar -->
  2. Jay Pegg
    Member
    Posted 5 years ago #

    I double-posted this in Troubleshooting because I figured I may have posted to the wrong thread here, due to lack of response. I would have deleted this one myself, but I don't have that option.

    Sorry to clutter the forum. Looks like no-one knows this fix...

  3. ukbloke28
    Member
    Posted 5 years ago #

    i dont know if it will help you but there is a widget that allows you to put as many images in the sidebar as you like and make them external links. it's very fast and simple to use:

    simple-image-widget.1.0

  4. jberghem
    Member
    Posted 5 years ago #

    You do know that can add images to your links in the blogroll right?
    Go to manage -> links and select the link you want to edit. Then scroll down to the "Advanced Options" click on "Advanced" and past the path to your image in the "Image Address" field.

    Then add the "Link" widget to your sidebar and you'll have your clickable images.

  5. Jay Pegg
    Member
    Posted 5 years ago #

    Hey ukbloke28 and jberghem - thanks for your replies.

    It looks like I just hadn't inserted the code properly. A friend fixed it with this <li><a href="http://www.link.com"><img src="<?php bloginfo('template_url'); ?>/images/s1.png" alt="" /></a></li>

    I'll close this now. (And cheers for those widget tips).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags