Using Outside Scripts and Systems

Finally, a few words about using gallery solutions outside of WordPress. There are several gallery scripts available, some of which are fully-fledged systems in themselves, while others just crunch images to various sizes and output content in physical folders on your server as HTML. They all have their place I just believe that isn't as a part of WordPress. Don't get me wrong here, I'm sure there's a reason to use Gallery2 (or any of the other popular image galleries) with WordPress at times,...

Social Networking Plugins

The social Web is a concept, and you've got a ton of profiles to the left and right. Each social book-marking tool has its own submit link, and while you can just add them all to your theme (which we'll get to later in the book), you can also rely on a plugin. It's all connected these days, after all. So why not add a little bit of the social Web to your site Show off your Twitter and let your visitors submit your content to Digg. You can do most of that directly in your theme with some custom...

Broken Link Checker wordpressorgextendpluginsbrokenlinkchecker

This nifty little tool keeps track of your links. When installed, it will browse through your blogroll, Pages and posts, looking for links that are broken. Then it lets you do stuff with them. Very handy, but I'm not sure I'd trust it to be running all the time. It does recheck every 72 hours by default, but you can have it check manually as well. WP e-Commerce If you want to turn your WordPress site into a Web shop, or perhaps just enhance it to sell some merchandise, then WP e-Commerce will...

Contents

PART I THE WORDPRESS ESSENTIALS 1 Chapter 1 Anatomy of a WordPress Install 3 Moving the WordPress Install to a Different Directory 8 WordPress and Switching Hosts 13 How to Make a WordPress Install More Secure 16 Chapter 2 The WordPress Syntax 19 Passing Multiple Parameters to a Template Tag 25 Understanding the WordPress Loop 32 Now You Get to Build Something 52 PART II DESIGNING AND DEVELOPING WORDPRESS THEMES 55

The Flickr Slideshow

If you're a dedicated Flickr user you may be interested in embedding a Flickr slideshow. Basically it is a small Flash widget that you can put wherever you want on your site, and even alter the size of. You can get a slideshow of anything grouped on Flickr, be it a full user's photostream or a set of photos. Naturally, the slideshow will only include public photos. R O Kiyomizu-dera temp te in Kyoto, Japan - a set on Flickr I < I I I + I 7603956972709 i zJ C , idhadengren > Collections >...

Display a Twitter Search Result

You can use the same method to display a search result as you did in the previous part, but for search of course. The Twitter API offers a lot of information on that, so if that's the route you want to take then by all means dig into it However, it is good to know that a search on Twitter also comes with an RSS feed, and while displaying just the latest tweet makes sense, just relaying the latest result from a search query does not. You may be better off just doing the search query yourself on...

Tweaking the Admin Interface

You can make the WordPress admin interface appear in tune with your needs by using one of the CMS plugins available. There are several, but WP-CMS Post Control (wordpress.org extend plugins wp-cms-post-control ) will probably get the job done. With this plugin, you can hide unnecessary elements for your users, disable autosave (which can be a nuisance), control which image uploader should be used, and a bunch of other things. It can really make the WordPress interface a little easier on the eye...

Working with Image Galleries

Ever since WordPress 2.5, there has been support for the gallery shortcode and the possibilities it brings. What gallery does really is output uploaded images in a clickable thumbnail grid. Then you can let your visitors see a larger version of the image, either in your theme's design, or the original file itself. The former is called the attachment page, since that's what images are attachments to blog posts. This built-in functionality should cover most of the needs you may have if you run a...

Show off Your Twitter

There is certainly no doubt that the rise of Twitter has changed things. These days everyone and their cat tweets, at least among the techie crowd, and it doesn't seem to be slowing down. So while 140 characters is quite a limitation to someone used to punching out 3,000-character blog posts, it can still be quite a tool for online publishers. If you or your brand are on Twitter, it is likely you'll want to promote the Twitter account on your site. That is easily done with graphics, of course,...

Essential Word Press Plugins

Chapter 12 Design Trickery 241 Placing Ads Within the Loop 251 Chapter 13 Extra Functionality 259 Sending e-Mail with WordPress 266 Chapter 14 Fun with Images 273 Working with Image Galleries 274 Making the Most of Image-sharing Services 282 Chapter 15 Integrating the Social Web 287 Lifestreaming with WordPress 291

The Word Press Theme Essentials

Managing Several Sites Using Child Themes Trimming WordPress on the Theme Side PART III DEVELOPING WORDPRESS PLUGINS 143 Chapter 7 Anatomy of a WordPress Plugin 145 Creating Your Own Template Tags 149 Things to Consider When Using the Database 162 Good Practice for Releasing Plugins 164 This Is Really All You Need 165 Chapter 8 Plugins and functions.php 167 When to Use functions.php Planning Your WordPress Site

Styling the Gallery

Making the galleries included with the gallery shortcode look good is easy, assuming you've configured your thumbnails according to the number of columns you'll be using. This is something you can choose when you're including the gallery, so you need to be wary of that. Actually styling the gallery is also pretty simple. The whole thing resides in a div with a number of identifying classes to use, one being called gallery itself. As is the norm in WordPress, there are unique IDs and classes as...

Word Press and ECommerce

It goes without saying that WordPress can be used to sell stuff. In its simplest form you'll run a blog or traditional site with WordPress as the backend, and use your reach to sell products. You can add affiliate links, which basically means that whenever you link to Amazon using your affiliate URL and someone buys something, you'll get a provision. In fact, if you bought this book by following a link from any of my sites, I made a little extra. Thanks However, when most of us are thinking...

Creating a Simple Admin Page

Function nbcore_options() echo '< div class wrap> ' < p> Get the latest Notes Blog and Notes Blog Core news from < a href http notesblog. com title Notes - it 's that sweet < p> Here, you basically just store the nbcore_options() function with the page you want to output in the admin interface. By putting a containing div with the 'wrap' class around it all, you get the WordPress admin interface look, so you probably want to be doing that. The three echo statements are simple...

Better Browsing with Lightbox

A Lightbox effect is a common name for an overlay that displays an image on top of a site, without opening a popup (see Figure 14-2). You need to close this to access the actual site again, which may sound like a bad idea, but compare it to having to open a new page to view the image in full size and you get the picture. Most decently designed Lightbox solutions have accessible browse buttons as well. This is pulled off with JavaScript and some design trickery, and there are a ton of possible...

How Child Themes Work

Any theme can be the mother of a child theme. The only thing that is really important is that the theme is located in your wp-content themes folder (because otherwise you can't use its files), and that the child theme is in its own folder, just like a regular theme. So if you want to use the Notes Blog Core theme as a mother template theme, you need to have it in the wp-content themes folder, and then you can have your very own Small Notes child theme (or whatever you want to call it) in its...

Polishing a Word Press Site

Learning the various tricks of the trade when it comes to WordPress is important to lift your site from just a mere WordPress theme (no matter how great) to something more complete. It is almost all about polishing, but any good site needs that, so you should experiment with techniques and see what you can do with your site. In this chapter you played with the design. The next chapter is about adding extra functionality, another way to polish your WordPress site.

Twitter Site Extensions

There are numerous widgets, plugins, services, and applications surrounding Twitter. The fairly open ecosystem around the microblogging service makes it easy to build on, and the ever-increasing buzz around the brand isn't exactly slowing things down. That's why you've got TweetMeme (tweetmeme.com) tracking the hottest stories on Twitter, as well as Twitterfeed (twitterfeed.com) that lets you post automatic links to your Twitter account using an RSS feed. The list goes on and on, and below is...

Event Child Themes

Or, to be blunt, say you want to make money by selling parts of your design to a company for promotion. Background images, slightly altered header files, that's all a breeze using child themes. Site-wide ads and roadblock-like functionality is easily implemented in this way. Using child themes for minor events, promotions, and other custom hacks is a great way to keep the main theme clean of such things. Any good theme designer will be doing this in the future, and some are probably employing...

The Stylesheet stylecss

Theme designers will be pleased to note that the description field supports some basic HTML code. Moving on, I have a reset segment. I'm opposed to the popular practice of applying a margin and padding reset to everything, since far from every element has these settings. That being said, I'm breaking my own rule somewhat with the following border reset body, h1, h2, h3, h4, h5, ul sidebar, ul.widgets, li, ul sidebar li ul, ol.commentlist, ul.children, ul footercol...

Using the Template Tags

Although WordPress is written in PHP, it is in fact a framework in itself. You can use PHP to do stuff with your WordPress theme or plugin, but most of the functionality is managed with template tags. If you open a theme file (just about any file with the extension .php, like index.php or single. php) you'll find a lot of PHP-like functions, such as this one, for example That is a template tag, and it outputs the blog's name. The PHP part, which consists of < php at first, and > at the end,...

Mixing Links Posts with Traditional Content

Maybe you want to mix this sort of linked title with your traditional content. You know, the kind of site where the post title leads to the actual post, and not elsewhere Right, you're with me. Good. So what you're looking at, then, is something of a linking aside. In fact, this is really easy to pull off. We'll just reuse the code and let the custom fields content check do all the work. Again, we'll use the index.php in the default WordPress theme as an example on how to pull this off < div...

Closer Look at Notes Blog Core

We'll be touching on the Notes Blog Core theme frequently from now on, so this section demonstrates the basic theme by taking the Core theme and cutting it down a bit to illustrate what a minimal WordPress theme can look like. Sure, you can make it even smaller still after all, you just need a style.css and an index.php to have a fully functional WordPress theme but it is a lot more likely that you'll use at least the most common template files. A few words about the Notes Blog Core theme are...

Build a Custom Feed URL

Sometimes you may want your feed to exclude a category, or consist of a couple of tags only, perhaps. This can be achieved by hacking the feed URL, which actually takes some parameters. Then, if you want to, you can run that feed through a service such as Feedburner, since the URLs tend to be pretty long and ugly. For example, say you want to exclude the category with ID 47 from your custom feed. Then the URL would look like this That would output the full RSS feed, but nothing in the category...