WordPress Bits

Hacking WordPress. Keeping the bits together.

Archive for August, 2007

Tip #5 : Taxonomy in WordPress 2.3

Posted by Leonid Mamchenkov on August 27, 2007

The upcoming release of WordPress 2.3 introduces a new way of tagging and categorizing posts and links.   It replaces the old way of categories and should provide enough flexibility to replace a whole bunch of plugins.  Or, at least, make those plugins much simpler.

This new feature required a few changes in the WordPress database scheme. Gladly, Ryan Boren has posted the description of changes in the database structure.


Posted in Database, WordPress, WordPress Tips | 15 Comments »

Tip #4 : WordPress cheat sheets

Posted by Leonid Mamchenkov on August 22, 2007

There is an excellent collection of WordPress cheat sheets at Kahi’s WordPress notes.  Cheat sheets provide a simple way of getting an overview picture of one specific topic, as well as to quickly find a name of a function or a variable.  The best thing about cheat sheets is that you can print them out, fold, and put on your table, so that a quick reference is just a look away.

If this type of documentation appeals to you, Lorelle has a whole bunch of cheat sheets for all things related to WordPress development – HTML, CSS, PHP, SQL, etc.

Posted in Documentation, WordPress, WordPress Tips | 12 Comments »

Making WordPress themes III : template hierarchy

Posted by Leonid Mamchenkov on August 22, 2007

(This is the third post in “Making WordPress themes” series. If you missed the previous two, here are the links: “Making WordPress themes I : static basics” and “Making WordPress themes II : The Loop” ).

In this post we’ll see which filenames WordPress recognizes in the theme directory, and how it knows which posts to show to the visitor based on where the visitor is.

Read the rest of this entry »

Posted in Documentation, Themes, WordPress | 38 Comments »

More WordPress theming at WPDesigner.com

Posted by Leonid Mamchenkov on August 21, 2007

I came across an excellent resource about WordPress theming – WPDesigner.com .  There are theme reviews, forum and few other bits worth checking out.  But the best part of the web site, in my opinion, are the Tutorials.  They are so good in fact that I decided to add the RSS feed to WPDesigner.com tutorials to the sidebar of WordPress Bits (see it on the left, below Archives).  Really cool stuff!

Posted in Themes, WordPress | 20 Comments »

Making WordPress themes II : The Loop

Posted by Leonid Mamchenkov on August 21, 2007

(This post is a second part of the “Making WordPress themes” series. The first part is “Making WordPress themes I : static basics“)

The Loop is perhaps the most important thing there is to understand in WordPress theme building. It is the heart, the soul and the skeleton of any WordPress theme. It’s been fairly well documented at Codex – see pages “The Loop” and “The Loop in Action” – but no WordPress theme building series could be complete without yet another attempt of making it easier to understand, so here we go…

Read the rest of this entry »

Posted in Themes, WordPress | 15 Comments »

Tip #3 : Under Construction

Posted by Leonid Mamchenkov on August 20, 2007

It is often desired to have a final version of the project on the production server for testing purposes, but so that nobody other than site administrators could see things. Also, once in a while, one needs to have a “Site under maintenance” page, even if for just a little while.

There are, of course, many ways to achieve the desired effect (e.g.: using a custom theme or an index.html preceding index.php). But probably the easiest and the most “proper” is by using Maintenance Mode Plugin. It provides a number of options to customize the displayed message, as well give visitors a hint of when it is better to come back. But what is more important, it allows logged in Administrators to see and use the web site like usual – invaluable for testing, as well demonstrations of a ready project to the client.

Posted in WordPress Tips | 26 Comments »

Making WordPress themes I : static basics

Posted by Leonid Mamchenkov on August 17, 2007

We’ve spent some time on WordPress internals already.  We looked at how things work in general, and how we can create plugins and widgets.  It’s time to look at another powerful tool that we have at our disposal – WordPress themes.

The topic of WordPress themes is large, but not complex.  I think it is better to separate it into several posts, each covering smaller parts with specific goals and examples.  In this First Post ™ we’ll see how to use WordPress themes to create the basics of basic web sites, as static, small, and simple as possible.

Read the rest of this entry »

Posted in Themes, WordPress | 45 Comments »

Tip #2 : Scheduling tasks with WordPress

Posted by Leonid Mamchenkov on August 15, 2007

Since WordPress 2.1 there is a way to schedule tasks from within WordPress (as opposite to using external schedulers). It is quite useful for doing systematic backups, cleaning user databases, importing data from other resources into your database, and things like that.

Glenn Slaven wrote a nice article – “Timing is everything: scheduling in WordPress” – explaining how to use this feature. If you read it through, tried, and failed to make it work, there is a Cron Demo plugin, which should get you started.

Posted in Plugins, WordPress, WordPress Tips | 7 Comments »

Adding options to WordPress plugins

Posted by Leonid Mamchenkov on August 15, 2007

Most WordPress plugins out there are simple things, fixing or changing one thing at a time.  But there are also examples of more complex things, like e-commerce and banner management, advanced anti-SPAM control, more flexible content and user management, etc.  One of the common things between those “advanced” plugins is that they almost always provide a user with a way to configure them – a screen with options.

In this post, we’ll see how to create plugins which integrate into WordPress options administration.

Read the rest of this entry »

Posted in Documentation, Menu, Options, Plugins, WordPress | 55 Comments »

Tip #1 : Lorem Ipsum – the king of test data

Posted by Leonid Mamchenkov on August 14, 2007

(With this post I’m starting a new category – WordPress Tips. It should carry small posts which make a life of WordPress hacker easier. If you have a tip, please let me know. )

While developing WordPress sites one often needs some test data. Sample blog posts, pages, comments, and thinks like that. When done manually, one often uses “this is a test” or “blah blah” sort of things. These are often too short, and longer version take too much time produce. There is a better way. It’s called “Lorem Ipsum“.

There are several tools online which generate Lorem Ipsum texts for you. However I found that Dummy Lipsum Firefox extension works best for me. Install it, restart your Firefox, right click over any text area, and select “Insert Dummy Lipsum“. Here is a sample of what you’ll get.

Aenean et risus eu purus porta aliquam. Proin rhoncus ornare elit. Donec leo dolor, posuere quis, mattis sit amet, pharetra id, pede. Proin nonummy vulputate augue. Cras mollis pretium pede. Sed consectetuer eros feugiat velit. Pellentesque elit. Curabitur nec dolor mattis sapien imperdiet mattis. Nam interdum ipsum. Sed tortor lacus, feugiat non, sollicitudin quis, interdum vel, purus. Proin ultrices ligula vel augue. Proin augue arcu, accumsan porta, fermentum sed, aliquam vitae, magna. Donec mauris metus, blandit a, egestas vitae, feugiat quis, risus.

Posted in WordPress Tips | 27 Comments »