Wednesday, September 04, 2013

WP-Property sidebar below content - how to fix

I've been working with the excellent WP-Property plugin for a client and have been really impressed with the free features that come with the plugin and consider the few premium addons that we needed to purchase really good value for the price that was paid.  BUT there was a problem - no matter what theme I used, and no matter how much I hacked at the CSS and plugin template pages (in my child-theme) I just could not make the standard Wordpress side bar appear on the right hand side of the content where it was supposed to.

Wordpress sidebar appearing below the content on the wp-property property listing pages.

This problem was only happening on the pages used to list the details of individual properties; I didn't notice it happening anywhere else.  On all other pages on the property website I was working on showed the sidebar where it should be: beside the content.  One the property detail pages the sidebar was appearing below the content and the part of the layout where the sidebar should be was just a big white space.  I was stuck.  I called in the services of a CSS guru who tried many things and resorted to saying bad words out loud to the pages of code we were looking at.  Then we fixed it very easily; here's how.

How to fix the sidebar being displayed below the content in the wp-property Wordpress plugin:


  1. Copy the file property.php from wp-content/plugins/wp-property/templates and save it to the root folder of your child theme.  If you don't have a child theme then make a copy of template.php and then hack at the file in-situ.  I would recommend creating a child theme first, here's how...
  2. At the bottom of your new copy of property.php add two DIV close tags (highlighted below) just above the property type sidebar code.


So how did we find this fix?  We decided to run the (live) page we were having trouble with through the W3C code validator and found that it failed.  Adding the two DIV close tags fixed the validation errors and put the sidebar where it should be - on the side of the content.

I am a little disappointed that a great plugin like wp-property would appear to have a rudimentary code error like this, but hey, pobody's nerfect.