Tony Thomas


Baseline Theme Version 1.1

September 5, 2010 8:01 pm Published by Comments Off

It had been a while since I’d done any WordPress development, but I recently dusted off my Baseline theme to start a new project only to find that the jQuery libraries weren’t loading properly. A quick bit of research revealed that new versions of WordPress require a slightly different syntax when using jQuery, so I made a few changes.

  1. jQuery UI is now loaded using wp_enqueue_script("jquery-ui"); instead of linking to Google’s hosted copy.
  2. The code for loading Superfish uses this syntax:
    jQuery(document).ready(function() {
            jQuery('ul.sf-menu').superfish();
        });
  3. Lists will now obey margins of neighboring floating elements by default because I declared this in style.css:
    div#content ul, div#content ol {
    	list-style-position: inside;
    }

Later versions of WordPress don’t support the ‘$’ syntax normally used with jQuery. Wherever you would normally use ‘$’ (such as $(document).ready ();), you have to use ‘jQuery’ instead (jQuery.document.ready();). There were a couple of other housekeeping items like reformatting style.css and creating a table of contents for it. Baseline should be all set to work with the latest versions of WordPress again. Download it here.

Similar Posts:


Tags: , ,

Categorised in: , ,

This post was written by admin

Comments are closed here.