Hello, everybody. I've been experimenting a very unusual and rather annoying behavior with one of my widgets on the sidebar after enabling Permalinks my blog. For those of you who are not familiar with or do not use the Permalinks feature, basically what it does is that it changes the way your links are displayed in the navigation bar through a rather simple mod_rewrite command added to the .htaccess file that lies in the domain root folder.
Before describing my actual problem, here's some useful information about my WP installation:
<style="text-decoration: underline>WP version:</style> 2.9.1.
<style="text-decoration: underline>WP Template: Apollo WP Theme
Relevant plugins running: Exec-php, Role Manager
<style="text-decoration: underline>Problem Blog:</style> Laws and Languages
Ok, so basically what is happening is that every time I try to enable Permalinks (any option other than "default"), my custom-made ads are no longer displayed: instead I only see blank spaces inside the box where they should be and also the links (but no actual images/ads). At first, my custom ads where displayed directly from the sidebar.php file called by standard div commands, but then since this blog is ran by my GF (who is not very html savvy) I thought of including them as a widget so she could move them around if she wanted to.
My first idea was to create a comads.php (stands for "COMmercial ADS") file inside my WP installation, and call that php file using the Exec-PHP plugin and a simple php include command (added as an "Arbitrary text" in the Widgets WP admin panel. That worked like a charm until I went and enabled the Permalinks feature.
After I encountered this problem, I thought there could be an incompatibility with the plugin, so I contacted the plugin developer who suggested I tried ABSPATH instead. I tried both ABSPATH and TEMPLATEPATH but neither worked, so I replaced the php function call with the contents of my comads.php file (without any of the php tags). This didn't work either. The funny thing is that if I disable Permalinks (set it back to Default), it's starts working, but the minute I enable it again it doesn't.
This is the markup html code for the ads:
<div class="comadspot">
<div class="comadspot2">
<!-- Ad1 start -->
<a id="comad1" href="mailto:info@lawsandlanguages.com?subject=Quote Request - Ad ID: LLcad1" title="Click on this Ad to request a quote"><span></span></a>
<!-- Ad2 start -->
<a id="comad2" href="mailto:info@lawsandlanguages.com?subject=Quote Request - Ad ID: LLcad2" title="Click on this Ad to request a quote"><span></span></a>
<div class="clearer"></div>
</div>
<div class="comadspot3">
<!-- Ad3 start -->
<a id="comad3" href="mailto:info@lawsandlanguages.com?subject=Quote Request - Ad ID: LLcad3" title="Click on this Ad to request a quote"><span></span></a>
<!-- Ad4 start -->
<a id="comad4" href="mailto:info@lawsandlanguages.com?subject=Quote Request - Ad ID: LLcad4" title="Click on this Ad to request a quote"><span></span></a>
<div class="clearer"></div>
</div>
<!-- Banner1 Start -->
<div class="combans">
<a id="comban1" href="mailto:info@lawsandlanguages.com?subject=Quote Request - Ad ID: LLban1" title="Click on this Ad to request a quote"><span></span></a>
<div class="clearer"></div>
</div>
</div>
Here's my CSS code for the ads:
/* Commercial Ads*/
#sidebar .widget .comadspot {
padding: 0 15px;
padding: 0;
width: 260px; }
#sidebar .widget .comadspot .comadspot2 {
display: block;
margin-bottom: 10px;
padding: 0; }
#sidebar .widget .comadspot .comadspot3 {
display: block;
margin-bottom: 10px;
padding: 0; }
#sidebar .widget .comadspot .comadspot2 .comad1, #sidebar .widget .comadspot .comadspot3 .comad3 { float: left; }
#sidebar .widget .comadspot .comadspot2 .comad2, #sidebar .widget .comadspot .comadspot3 .comad4 { float: right; }
#sidebar .widget .comadspot .comadspot2 .comad1 {
background: url("http://www.lawsandlanguages.com/wp-content/themes/apollo/images/Ads/commercial/LLcad1.jpg") no-repeat 0 0;
height: 125px;
width: 125px; }
#sidebar .widget .comadspot .comadspot2 .comad1:hover { background-position: 0 -125px; }
#sidebar .widget .comadspot .comadspot2 .comad1 span { display: none; }
#sidebar .widget .comadspot .comadspot2 .comad2 {
background: url("http://www.lawsandlanguages.com/wp-content/themes/apollo/images/Ads/commercial/LLcad2.jpg") no-repeat 0 0;
height: 125px;
width: 125px; }
#sidebar .widget .comadspot .comadspot2 .comad2:hover { background-position: 0 -125px; }
#sidebar .widget .comadspot .comadspot2 .comad2 span { display: none; }
#sidebar .widget .comadspot .comadspot3 .comad3 {
background: url("http://www.lawsandlanguages.com/wp-content/themes/apollo/images/Ads/commercial/LLcad3.jpg") no-repeat 0 0;
height: 125px;
width: 125px; }
#sidebar .widget .comadspot .comadspot3 .comad3:hover { background-position: 0 -125px; }
#sidebar .widget .comadspot .comadspot3 .comad3 span { display: none; }
#sidebar .widget .comadspot .comadspot3 .comad4 {
background: url("http://www.lawsandlanguages.com/wp-content/themes/apollo/images/Ads/commercial/LLcad4.jpg") no-repeat 0 0;
height: 125px;
width: 125px; }
#sidebar .widget .comadspot .comadspot3 .comad4:hover { background-position: 0 -125px; }
#sidebar .widget .comadspot .comadspot3 .comad4 span { display: none; }
#sidebar .widget .comadspot .combans { padding: 0; }
#sidebar .widget .comadspot .combans .comban1 {
background: url("http://www.lawsandlanguages.com/wp-content/themes/apollo/images/Ads/commercial/LLban1.jpg") no-repeat 0 0;
display: inline-block;
float: center;
height: 126px;
width: 260px; }
#sidebar .widget .comadspot .combans .comban1:hover { background-position: 0 -126px; }
#sidebar .widget .comadspot .combans .comban1 span { display: none; }
And here are the contents of my .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Any help on this WILL be greatly appreciated, since I've been going crazy trying to figure out why the heck this is happening in the first place.
Thanks!