Posts tagged WordPress

Setting up a multi-blog installation

The CASL Ambassadors web site is actually a collection of WordPress blogs – the main site plus one for each of six age group teams.  When I initially set it up I tried using WordPress-MU but my hosting solution wasn’t capable for MU’s requirements.  Then I tried a plugin called WP-Hive which allows a collection of blogs to share some common infrastructure.  Wp-Hive looked promising but I ran into some concerns which kept me from using it.

Ultimately I ended up setting up a separate blog for each site and hoped to come back to it at some point.  That point was a couple weeks ago when I decided to do some maintenance on the sites.  I ended up using the main installation as a parent and linked (using Unix symbolic links) all of the sub-domain sites back to parent.  The only exception was the wp-content directory which is a real directory (so uploads can be unique) but within wp-content I linked back to the parent’s themes and plugins.

This worked pretty well – if I install a plugin or theme for the main site it is available for all of the sub-domain sites and when I upgrade WordPress, all of the sub-domain sites are upgraded as well.  Once I got this running, I wanted to share the users across all blogs.

After several attempts and numerous Google searches, I ended up following the directions in this thread and this thread and got everything to work.  I don’t particularly care for having to modify one of the core WordPress files since it will go away the next time I update WordPress but none of the other solutions I tried worked.

jQuery, jQueryUI, jQuery UI widgets and theme options

Over the past few days I have been dinking around with jQuery, in particular some of the jQuery UI widgets.  I am working on a revamp of a LEGO WordPress theme and I wanted to allow the theme to support multiple color schemes and custom headers.  This is a learning project for some other themes I want to update (e.g. Swim Team and Soccer).

For the header I wanted the user to select 1-3 images from the media library to use in the header.  I also wanted to allow some styling control over the blog title and tagline and lastly choose a color scheme from a selection of 10-12 choices.  All of this information would make for a very busy theme options page so I decided to make use of the jQuery UI Accordion widget to logically group information into sections.

My theme development area was still running on WordPress 2.7.1 which includes jQuery 1.6 which is not the most recent version.  I should have upgraded WordPress before embarking on my Accordion experiments, I would have saved myself a bunch of time!

As it turns out, Accordion isn’t shipped with WordPress so I have to download it and install it as part of my theme and then load it.  This isn’t a big deal, there are lots of posts across numerous blogs that explain how to load Javascript correctly.  No matter what I did, I couldn’t get it to work.  I played around with jQuery UI Accordion and half a dozen similar solutions trying to get it to work but I could only get one solution partially working.  In the end, I decided to try updating WordPress and start with the latest and greatest.

What do you know?  My Accordion worked perfectly!  So after wasting the better part of two days trying to work with what I had installed, simply updating WordPress was the right answer.  I think the real change was in the jQuery UI ui-core component as at one point I had Accordion working in the older version but only when I loaded the custom packed jQuery download.  When I loaded just the Accordion source file it wouldn’t work.  The custom packed file included something out of jQuery UI ui-core, what I don’t know but it made a difference.  When I looked at the jQuery code in the 2.8.4 release I noticed the ui-core component also had this function where as the 2.7.1 did not.  So something was definitely different and it make a big difference.

Now that I have the Accordion working I am back to making progress on my theme options page.   I have played with jQuery just a bit, this is the first real jQuery application I have worked on.  It is pretty powerful, I can see why it has gotten so much traction.

Why?

I started a new blog today.  Why?  To keep track of all of the interesting things I find as I scour the net looking for solutions to whatever WordPress problem I am currently trying to solve.  I can’t remember how many times I have gone looking for something, found what I was looking for, used it or discarded it, and moved on only to need it again a month or two later.

This happened to me recently when I was working on adding custom icons to the Dashboard.  Found a great article, got distracted, closed my browser, couldn’t find it again.  Great.  Two days later I found it again.  Now when I find something I like, I’ll post it here.