Baseline Theme Version 1.1
September 5, 2010 8:01 pm Comments OffIt 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.
- jQuery UI is now loaded using
wp_enqueue_script("jquery-ui");instead of linking to Google’s hosted copy. - The code for loading Superfish uses this syntax:
jQuery(document).ready(function() { jQuery('ul.sf-menu').superfish(); }); - 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:
- Baseline Theme Version 1.1
- Introducing the Baseline Development WordPress Theme
- Baseline WordPress Theme Version 1.0.2
- Why Use Blueprint and the 960 Grid System in the Baseline Theme?
- Incorporating Blueprint CSS Into Your New WordPress Theme
Tags: baseline theme, web development, wordpress
Categorised in: Baseline Theme, web development, wordpress
This post was written by admin
Comments are closed here.