Adding a sidebar to post view in Twenty Eleven WordPress Theme


Something else I missed when looking at themes for my new blog was post template options.

Seems as though the Twenty Eleven theme won’t display the sidebar when viewing a post/article.

Thankfully, it’s not a huge modification and there is lot’s out there on how to do it.

Basically, you modify the theme’s single.php file and add the get_sidebar() function. But that in itself will not be enough, you need to adjust some CSS as well.

I had tried with just the get_sidebar() modification… but after a quick search I found an example.

Check out Zeaks “ADD SIDEBAR TO POST VIEW IN TWENTY ELEVEN THEME” for an example on how to modify the CSS to make this work.

I used it as a reference and it worked great.

How to add custom banners to Worpress TwentyEleven theme


I’m setting up a new personal blog and settled on using WordPress’s Twenty Eleven theme that ships with current downloads.

I wanted to create custom banners to be displayed in the “Header” settings under the “Appearance” menu.

I thought they could be uploaded, this was something I simply presumed and didn’t actually check. I had seen the options to display a random header but hadn’t actually tried it… or read everything for that matter… 😉

There aren’t any uploaders. If you do upload a custom banner it is set as the banner for all pages.

The work around was quite easy, if you can follow PHP code of course.

First, create the banners you want to have on the blog, at appropriate sizes of course (defaults are 1000 × 288 pixels for the banners on the Twenty Eleven Theme out of the box). Then, your thumbnails (230×66 pixles, less important as it’s for the admin panel)…. then go into the theme’s image folder (unless you want to change those settings, but we won’t get into that here). Theme folder should be in:

Upload your banners and thumbnail images.

Once that is there, you must open the theme’s functions.php file (in twentyeleven’s root folder). In there, find the register_default_headers() function. You’ll want to configure your custom banners in the arrays as such:

register_default_headers( array(
'every-man-lives' => array(
'url' => '%s/images/headers/first-banner.jpg',
'thumbnail_url' => '%s/images/headers/first-banner-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Banner 1', 'twentyeleven' )
'love-dies' => array(
'url' => '%s/images/headers/second-banner.jpg',
'thumbnail_url' => '%s/images/headers/second-banner-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Banner 2', 'twentyeleven' )
) );

Once you’ve registered the new banners, refresh the admin panel Header or Custom Header page and check out the public site.

Was nice and simple.

Building a WordPress plugin – Useful video


Recently I’ve been working on a couple of ideas for a WordPress plugin and since it’s something I haven’t done yet, meaning writing a plugin from scratch, I thought I’d do a little research. I’m familiar with Hooks and how filters and actions work…. but I figured a little research would be wise.

Research is always wise. 😉

Found this video and thought I’d share. This is from 2009 but much of what’s discussed is relevant.

Magento Error: Method Varien_Object::__tostring() cannot take arguments in Magento


Today, I started backing up a Magento based site that will be moved in coming days. I did a bit of reading around to try to get a feel for what kind of an endeavor this would become.

The process of backing up the database and all web files were quite straight forward (as they should have been).

I decided to attempt the get this version of Magento running on my local dev box using MAMP before setting it on the newer server and repointing the DNS entries. So I imported the database and transfered all Magento files into the web directory.

Following some instructions found in the Magento forums, I modified the /app/etc/local.xml file with the new database settings in my MAMP install.

Then, I changed 2 rows in the core_config_data tables. (more…)

How to reset WordPress to default data?


I’ve had my head in quite a few WordPress based sites as of late. Something I’ve had to do on our development space is setup new WP installs to clear out the settings.

Today, I found “WordPress Reset“, a handy little plugin that allows to wipe out WP content to defaults. If you’ve got multiple themes setup, don’t need to worry…. it doesn’t touch the files at all. It just resets the WP database.

It also saves your admin account.

Check it out.

Very useful WordPress 3 User Guide


I’ve recently developped a few sites based on WordPress and have done a bit of training with users on how to administer their websites. Like editing their texts, images, categories, tagging….etc.

So I’ve been thinking about developing a half visual document for them. Something that would contain the generic “Post, Page, Category, Media”…etc. Along with some documentation on installed plugins or theme options which would be a bit different depending on the site.

This morning while doing a quick Google Search, I came across what appears to be a VERY well done WordPress guide and thought I would share.

Configuring Routes in Kohana


At first when I looked into using Kohana I was quite happy and comfortable to use it. As a matter of fact, I still am.

Routing was one thing that I had some trouble with.

Now I don’t know if it was because when I read through some of the articles online and/or forum posts that my mind was hazy with coffee… could be.

Recently I was once again into some code that had been worked on for a project using Kohana v3. And at once the issue of routes had come to mind….. I had always thought about making some kind of “catch all” to avoid errors and such for missing controllers…etc.

But while reading a bit (with a fresh cup of coffee I might add) it just struck me in a different way. I don’t know why I didn’t seem to understand it before…. but I now understood that I could set up various  routes allowing access to controllers and also using a “catch all” of sorts. And the way Kohana uses it’s modules, I could create an init.php file inside  each module directory to define the routes instead of messing with the bootstrap.php file.

Role Scoper – A handy WordPress plugin


Recently I’ve had my nose in WordPress alot. Kind of gotten to be quite fond of it actually.

Was putting a site together that required something a little more special then your usual blog. This was to become more of a CMS then a blog.

Pages, sub pages, blog section, news section….etc.

Multiple user accounts that needed to access only certain pages and sub pages…. and also some users that would post news, some to blog categories and/or blog sub categories.

Very long list of PHP frameworks


Here’s a quick little rant before I post the link to the long list of frameworks…

Just a few months ago I was looking at frameworks. I had thrown myself in the fire of a PHP project and it’s really something that I’d never done from start to finish.

I thought using a framework would help me out a bit since this was to be my first “start to finish” PHP app. After looking at a few frameworks on really stuck out to me.

I’d been a bit familiar with MVC type frameworks from using Model-Glue in ColdFusion development and after using it in a couple of different projects I generally liked using an MVC framework.

So today, I’m just reading through me RSS reader and I found this blog post which was linked… this is a list of 79 PHP frameworks. I certainly would not have looked at all the options on that list….. and I still wouldn’t consider going through so many.

To link that long list with the few paragraphs above…. for that PHP project that I mention… well I had settled on number 7 on that list. Kohana.

Finally, click here to see the list of 79 PHP frameworks.

Finding some help debugging Drupal (and PHP)


I’m very thankful for the internet. Actually, if it weren’t for the very existence of the internet… I suppose I wouldn’t encounter half the challenges and problems that I do…. in code of course.

I come from a Web development background and for the better part of the last 9 years I’ve spent countless hours reading through ColdFusion code (mostly). In 2010 so far, almost every job I’ve done has involved PHP in some form or another. If it was adding a feature to a previously coded site.. or building a site from scratch (it was direct requirements!)…. this year it’s been PHP.

I’ve been learning in 2010. On many levels actually.

So here I am reading through drupal code, learning how things are organized and where methods are calling other methods… still getting familiar with reading the code. I programmed a plugin for a Drupal module and everything was going well. Then after adding some processing to a form with file upload I had a problem. After submitting the form, it was a blank screen.

Go to Top