• Hi,
    I’ve done a search on the archives but haven’t found a relevant solution. In the theme’s “header.php” I’ve placed a table as below. It displays 2 adsense ads with small images next to the ads on the left handside. My images dir is in my root folder.

    The images display fine on the front page. But clicking on a heading or on the comments causes the image not to display. And that’s because the path has now changed. On the front page the path ” ./images/36_1.jpg”

    But once we move off the front page the path is now https://blog.com/archives/2006/08/23/images/36_1.jpg.
    This off course breaks the image display. My Permalink structure is “/archives/%year%/%monthnum%/%day%/%postname%.htm”

    So how do I fix this so that the images always reference the folder in the root. I tried using the full path https://blog.com/images/36_1.jpg but that didn’t work. A .htaccess issue?
    Appreciate any help on this one. Thanks.


    <body>
    <div id="container">
    <div id="header"><a href="<?php bloginfo('url'); ?>"> </a>
    <h1> Blah Blah Blah</h1>

    </div>
    <div id="main">
    <div class="mtbox"><div align="center"><h2><?php bloginfo('name'); ?></h2></div>

    <table width="100%" border="0" cellspacing="0" cellpadding="2">
    <tr valign="top">
    <td width="20%"><img src="./images/896_1.jpg" alt="Sony Ericsson" width="75"></td>
    <td width="80%" rowspan="3">
    <script type="text/javascript"><!--
    google_ad_client = "pub-0000";
    google_ad_width = 336;
    google_ad_height = 280;
    google_ad_format = "336x280_as";
    google_ad_type = "text";
    google_ad_channel ="";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "0000FF";
    google_color_text = "000000";
    google_color_url = "000000";
    //--></script>
    <script type="text/javascript"
    src="https://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
    </script>
    </td>
    </tr>
    <tr valign="top">
    <td><img src="./images/760_1.jpg" alt="Siemens" width="75"></td>
    </tr>
    <tr valign="top">
    <td><img src="./images/36_1.jpg" alt="NEC" width="75"></td>
    </tr>
    <!-- end ad1 -->

    <!-- start ad 2 -->
    <tr valign="top">
    <td width="20%"><img src="./images/893_1.jpg" alt="Sony Ericsson" width="75"></td>
    <td width="80%" rowspan="3">
    <script type="text/javascript"><!--
    google_ad_client = "pub-00000";
    google_ad_width = 336;
    google_ad_height = 280;
    google_ad_format = "336x280_as";
    google_ad_type = "text";
    google_ad_channel ="";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "0000FF";
    google_color_text = "000000";
    google_color_url = "000000";
    //--></script>
    <script type="text/javascript"
    src="https://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
    </script>
    </td>
    </tr>
    <tr valign="top">
    <td><img src="./images/952_1.jpg" alt="Siemens" width="75"></td>
    </tr>
    <tr valign="top">
    <td><img src="./images/873_1.jpg" alt="NEC" width="75"></td>
    </tr>

    <!-- end ad2 -->
    </table>

    </div>

Viewing 2 replies - 1 through 2 (of 2 total)
  • when you tried using the “full path” did you write it out fully ?

    http: // www.yourblog.com/images/pic.jpg

    You can also include:

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

    In the a href tag as the base of the link; this way if your website url changes that would change with it and should work on any page. for example:

    <a href="<?php bloginfo('url'); ?>/images/mypic.jpg"></a>

    Thread Starter Avo

    (@avo)

    Thanks heaps for that info. Solved my problem perfectly.
    Good karma to you ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Images next to Adsense in header not showing except on front page.’ is closed to new replies.