WordPress Development: Multiple Sidebars

Published on Jul 29, 2009   //  Development
Off

WordPress Development

We have previously covered how to add a widgetized sidebar to your theme and how to develop widgets. It is also possible to create a theme with multiple sidebars that are widget enabled. Today we’ll be going over how to achieve this.

Creating multiple widget-enabled sidebars is very similar to creating a single sidebar. In fact, the only thing we need to change is the code in our functions.php, the code in our sidebar.php file stays the same. Previously we used register_sidebar() to register our sidebars. To create multiple sidebars, we’ll be using register_sidebars() (it’s plural, if you didn’t notice the difference). This function is similar to register_sidebar(), in that it accepts the same parameters, but it also accepts a count parameter and a name parameter. Let’s take a look at an example of this:

[php]if (function_exists(‘register_sidebars’)) {
register_sidebars(2, array(
‘name’ => ‘Sidebar %d’,
‘before_widget’ => ‘<li class="widget">’,
‘after_widget’ => ‘</li>’,
‘before_title’ => ‘<h3>’,
‘after_title’ => ‘</h3>’,
));
}[/php]

Where the first parameter is the number of sidebars you want. The name parameter goes with the other parameters (the name will be run through sprintf() and %d will be replace with a number).

This code will create two sidebars with the same markup parameters. If you instead want multiple sidebars with different markup, just use the register_sidebar() method multiple times (and add in a name parameter).

Community Poll

Published on Jul 29, 2009   //  Polls
Off

This poll will help with WordCamp and what will be covered. That is why it is being posted again…

{democracy:90}

Blogathon Sponsored Posts

Published on Jul 29, 2009   //  News Worthy
Off

If you were following me on twitter you saw that I was a part of blogathon. I wrote 41 Social Media 101 posts on my blog on my site all of which were or can still be sponsored. The one’s below shown as Taken are no longer available. Those that are not taken yet can be sponsored for a $25 donation to Team Diabetes. Contact me after you donate or tweet me through twitter to let me know which page you wish to sponsor. Your link will be available on the blog for life so it’s a pretty good deal for a $25 donation.

Social Media 101 – Create an Account Taken

Social Media 101 – Setting Your Profile Taken

Social Media 101 – Creating a Background

Social Media 101 – Updating Your Avatar Taken

Social Media 101 – Hunting for Business on Twitter Taken

Social Media 101 – Scheduling Tweets

Social Media 101 – Hooking in Your Blog

Social Media 101 – Tweetups

Social Media 101 – Reclaiming Your DM

Social Media 101 – Being Retweated

Social Media 101 – Ping.fmTaken

Social Media 101 – Blip.fm Taken

Social Media 101 – Future of Sp@m

Social Media 101 – Tweet After Purchase Link

Social Media 101 – Twitpic

Social Media 101 – Pulling in Content

Social Media 101 – Twitter Poll

Social Media 101 – iPhone Applications

Social Media 101 – Blackberry Applications

Social Media 101 – Google Killer

Social Media 101 – Twitter Coupons

Social Media 101 – Twitter Verified

Social Media 101 – April Fools

Social Media 101 – 12seconds.tv

Social Media 101 – YouTube

Social Media 101 – YouTube Experiment

Social Media 101 – Tube Toolbox

Social Media 101 – Hummingbird

Social Media 101 – Facebook Friend Adder

Social Media 101 – I 0wN3d UR Tw33T5

WordPress Wednesday: WP Change Template

Published on Jul 29, 2009   //  WordPress
Off

They say that it is important to have a unique theme or template for your blog, because this will give it a spark of personality and help it stick out from the crowd. That’s why there are so many WordPress designers out there who are developing new templates all the time, catering to different niches and preferences. What if you want to have a special theme for special times of the year?

Normally, you would have to go into your WordPress dashboard and switch the theme manually on the dates that you want to use a different template. Rather than take the manual route, you may want to consider a solution like WP Change Template. This free WordPress plug-in will automatically change the theme on your blog for the dates that you define in the options panel.

For instance, if you want to have a special theme for Thanksgiving or Christmas, you can go into the WP Change Template administration area in your WordPress dashboard and tell it to change to your Thanksgiving theme for a certain date range. At the end of this range, your blog will automatically revert back to the theme that you have set as its default. This can bring up all sorts of marketing, branding, and holiday-themed possibilities.

Check out the WordPress repository for more information and to download WP Change Template.

Everything PHP: SQL: UPDATE

Published on Jul 29, 2009   //  Development
Off

Everything PHP

An update query will allow you to update an existing row (or rows) in the database based on a certain set of criteria. In an update query, you specify the fields and their new values and some criteria on which rows to update.

[sql]UPDATE table SET field = ‘value’[/sql]

You may choose to not specify which rows to update, if you want all the rows in the table to be updated.

[sql]UPDATE table SET field1 = ‘value1′, field2 = ‘value2′ WHERE field3 = ‘value3′[/sql]

Using the where clause will allow you to set the criteria for updating the rows.

It is also possible to limit the number of tables that will be updated. By using a limit parameter you can limit the number of rows that will be matched with the where clause (MySQL won’t update the row if the fields are already on the field, but it will still count this row against the limit).

[sql]UPDATE table SET field1 = ‘value1′, field2 = ‘value2′ WHERE field3 = ‘value3′ OR field4 = ‘value3′ LIMIT 4[/sql]

You may also specify multiple tables to be updated in a single query. Which looks like this:

[sql]UPDATE table1, table2 table1.field1 = ‘value1′, table2.field1 = ‘value2′ WHERE table1.field3 = ‘value3′ OR table2.field3 = ‘value5′[/sql]

There you have it, an update query.

Business 101: Streamlining the Product Line

Published on Jul 28, 2009   //  Business Topics
Off

I think we would all agree that Apple has done very well with the iPhone, quickly propelling the device to become one of the most popular smartphones on the market today. There are a myriad of reasons why the iPhone has been so successful. Part of it has to do with the sleek design, but there are other smartphones with a similarly sleek appearance. Part of it has to do with the intuitive touchscreen interface, but there are other smartphones that have touchscreens too. A big part of it is clever marketing and product placement, but there is another element at play here.

Since the introduction of the product line in 2007, Apple has only released three variations on the iPhone. We had the original iPhone, the iPhone 3G last year, and the iPhone 3GS most recently. This keeps the product line relatively straightforward and simpler to understand for the end user. Nearly any customer can walk into a Fido or Rogers kiosk and simply ask for an iPhone. They have a general idea of what they want and they don’t have to fumble through the confusion of multiple model variations.

Contrast this to the experience that a customer may have when looking to select a BlackBerry. The BlackBerry smartphone line may be perfectly suitable for a range of customers and it could offer nearly all the same features that you can find on the iPhone, but the product line can be very confusing. Let’s say that you are interested in the BlackBerry Pearl. There are at least four versions of that smartphone, not including the Pearl Flip. Say that you want a BlackBerry Curve. Just like the Pearl, there are three versions in the 8300-series, as well as the newer 8900 and the upcoming 8500-series. The differences are relatively minor, but they’re there and they could be a source of confusion.

In developing your product line, you may want to consider taking Apple’s strategy and keeping the line as simple as possible. Here is product X and we are only offering product X for this kind of market. Alternatively, you can consider the conventional strategy of developing slightly modified versions to satisfy slightly different needs, but know that you will have to invest more time (and money) into consumer education so that they can understand these differences.

Page 2 of 1912345...10...Last »