Web Programming

WordPress 3.0 TwentyTen Child Theme Header Image

The new Twenty Ten theme for WordPress 3.0 provides support for uploading custom header images. Uploaded images are cropped to 940 x 198 pixels. So your options are:

  1. Ensure that your header image size is 940 x 198 pixels.
  2. Modify the Twenty Ten theme to change this size
  3. Create a child theme which overrides the size

I’m going to show you how to do option 3: change the Twenty Ten theme header image size. “Creating a child theme is the way of the future” (I think that Yoda said that, but I’m not sure).

The Twenty Ten header image size is defined in the functions.php function twentyten_setup(). The WordPress team has thoughtfully provided filters to simplify overriding the default height and width:

// The height and width of your custom header.
// You can hook into the theme's own filters to 
// change these.
// Add a filter to twentyten_header_image_width
// and twentyten_header_image_height to change these values.
define( 'HEADER_IMAGE_WIDTH', 
   apply_filters( 'twentyten_header_image_width', 940 ) );
define( 'HEADER_IMAGE_HEIGHT', 
   apply_filters( 'twentyten_header_image_height', 198 ) );

You can define filters named “twentyten_header_image_width” and “twentyten_header_image_height” which will override the default values of 940 and/or 198.

To create filters which override these values, create a functions.php file in your child theme and add the following lines:

add_filter('twentyten_header_image_height','my_header_height');
add_filter('twentyten_header_image_width','my_header_width');
function my_header_height($size){
   return 300;
}
function my_header_width($size){
   return 900;
}

In this case I am ignoring the default sizes that are passed into the filter and simply setting them to the values that I want (900×300).
Be sure to change the prefix ‘my_’ to something more appropriate and unique to your child theme to avoid possible naming conflicts.

That’s all it takes! Use the Appearance -> Header control panel to upload a new header image now. The control panel should now display the size that you set with these filters, and the new size reflected on the website.

Now having said that, I subsequently decided that I want different sizes and layouts for the front and other pages, so I ultimately modified the header.php file. Don’t judge me.

WordPress 3.0 RC3

WordPress 3.0 RC3 was released yesterday.

Once of the very cool new features being added to WordPress 3.0 is support for child themes. This capability will allow a web developer to create a new theme by overriding the settings of an existing (or parent) theme.

Combined with the new Twenty Ten default theme, this is going to make the creation of WordPress themes easier and less error-prone. The new Twenty Ten theme contains a lot of comments explaining how to derive a new theme from it.

This blog is using a new theme created this way. I’ll explain how each of the changes is made as I go along.

Note to Safari users: the new develop menu in 5.0 allows you to use Safari for web development in a manner similar to that previously requiring Firefox.  Check it out.

Dreamweaver CS5

I’ve been looking at the updated Dreamweaver CS5. I had been using Dreamweaver CS3 about 2 years ago, and abandoned it because of the problems it created with my custom PHP coding.

Well it appears that during CS4 and now CS5 Adobe has fixed a lot of those problems and added features specifically targeted for power coders like myself.

Perhaps the most interesting new feature is the support for working in CMS environments like WordPress and Joomla. I like to code extensions and themes for these environments, so this is a big plus for me.

There is a 30 day free trial, so over the next month I’m going to be giving it a whirl.

Lynda.com has a full tutorial on using Dreamweaver CS5, so I’ll be working through that also.

Joomla Security

I found some good tips on Joomla security at HotJoomlaTemplates.com:

  • Keep your Joomla core up-to-date.
  • Keep all your Joomla extensions (components, modules, plugins, templates) up-to-date as well. Follow extensions’ websites and upgrade each extension as soon as new version is realized.
  • Uninstall all extensions that you don’t need.
  • Delete superadministrator’s account with ID=62, if it exists in your Joomla user manager.
  • Change default username of your superadministrator’s account from “admin” to something else.
  • Use passwords that are combination of lowercase and uppercase letters, numbers and special characters.
  • Don’t CHMOD files on your server to 777. Use 644 instead. When your need to change some files, CHMOD them to 775 and, once you’re done, back them to 644. Use FTP software to CHMOD files.
  • When installing Joomla, use DB prefix different from default (jos_). If your current website uses this prefix, you still can change it using phpMyAdmin in your hosting control panel.
  • Even if you follow all above instructions, your website still can be hacked. Chances are less, but certainly not 0%. Check with your hosting provider if they make regular server backups. Check if site restoration is included in price. Check how many times you are allowed to make site restorations per month/year. Check how much time you should wait for site restoration.

Adding Website Workshops Forum

I’m looking into selection of a forum (bulletin board) for use with Build a Website Workshops as well as for my WordPress plugin. For Workshops I want something that integrates nicely with Joomla! but I may choose something different for my WordPress plugins since it needs to integrate nicely with WordPress 🙂
At first glance, Joo!BB looks attractive. However, forum.joomla.org uses phpBB. I’m guessing that this might be because they selected phpBB long ago, and it doesn’t make sense to switch even if there are better options now.
I’m going to try installing joo!BB on my BuildAWebsiteWorkshops.com site and see how it works.

Web Design Consulting

After much prayer and discussions with friends and family I have decided to hang up the web design shingle. I’ll be looking at specializing on websites for small churches with limited budgets. It isn’t at all clear at this point how I will support my family, but this is the direction that I think God is leading me.

I created a website awhile back to try to help other churches with this, so I will be focusing even more on this effort. It occurred to me last night that I should include a section on open source tools also: Gimp and KompoZer for starters.

Back from the Holidays

The past few weeks I’ve been studying and working with WordPress and Joomla!

I’ve brought up our church and band websites on the latest WordPress, and am somewhat unhappy with the user experience that is presented to other authors (eg. my wife). This prompted me to take a look at Joomla! Lynda.com provides a tutorial on it, so I went through it. There is a steeper learning curve on Joomla! but it appears to be much better suited to supporting multiple, less skilled authors. There doesn’t appear to be as much information available (yet) on how to create and modify templates and plugins, but I’m diving in anyways.

I going to convert my BuildAChurchWebsite website to Joomla! and see how that works.

Chords and Lyrics WP plugin Public Release v1.3

I’ve submitted the form to WordPress.org requesting access to their svn to release the Chords and Lyrics publicly.

I’ve removed the old widget, and replaced it with an options page in the Users admin menu. Since this is per-user configurable, I thought that the Users menu was the correct place. But upon rethinking this, I think the correct place is under Appearance. I can easily move it if someone explains to me why another menu would be better 🙂

I’ll post an update when it goes live.

WordPress Development

I’ve been working on revamping the church’s website. I’ve been doing a lot of searching and reading.
I must say that I’m pretty shocked at how expensive a lot of the church solutions are. Understand that my church is operating on a shoe string budget, so any recurring expenses need to be small.
On the other hand, I’m also very pleased to see the work that some folks have done in this regard. There are several pretty good sites that are advocate using WordPress to create maintainable church websites. It’s been awhile since I’ve dug under the covers of WordPress, but I’ve got the itch to do so again. I’m going to launch a new site targetting the use of WordPress for church websites. Since I’m in the midst of updating my own church’s website using WordPress, this will be a good place to post my own themes and plugins, provide suggestions, and link to other good church related sites.

Improving my Skills for a new line of work

In trying to discern where God is sending me, I’ve had the feeling that there are 2 strong possibilities:

  1. Utilize my web programming skills in order to extend our band site.
  2. Brush up my Cocoa skills and get involved in iPhone development.

I’ve been playing with our church’s band website for several years, and it occurs to me that this might be something that I could extend to allow other churches or music related organizations to use. I think that some of the key features are the ability to create lead sheets, reuse them in lineups, and transpose them. The ability to strip out the chords for use by singers is also very useful. I had originally implemented this as a WordPress plugin, but then converted it to a Zend Framework based custom application, eventually adding Dojo support. I’m thinking about moving it back into WordPress.

iPhone development has always appeared very appealing also. I’ve recently started refreshing my Mac Cocoa programming skills, and these are exactly the same skills needed for iPhone development. Earlier this week I had joined the iPhone development program. I have some ideas about a simple application to use with my drumming. My primary motivation for doing this though is to work on an iPhone application which would access the band site to display the current week’s lineup and allow playing the MP3s.

I plan on using my C# skills to create similar applications for the PC in addition to a Mac Cocoa application which would use the same web service for listing the current week’s lineup using a PC or a Mac.