Content Integration Via Feeds

In one situation we've encountered, we managed many sites, normally a subdomain for each department. In this example, each department functions as its own business unit. There are alternatives, but for various reasons each site became a unique WordPress installation. One of the challenges we then face is the duplication of content across multiple sites. Maintaining changes across these separate FIGURE 13-7 OpenID enabled WordPress login page FIGURE 13-7 OpenID enabled WordPress login page sites...

Advanced wpconfig Options

You can set additional advanced options in your wp-config file. These options are not in the wp-config file by default, so you will need to manually add them to the file. To set your WordPress address and blog address, use the following two options define('WP_SITEURL', 'http example.com wordpress') define('WP_HOME', 'http example.com wordpress') The wp_siteurl option allows you to temporarily change the WordPress site URL. This does not alter the database option value for siteurl, but instead...

Integrating Twitter

Even though we just used Twitter as an example of how to integrate any XML feed, let's look at how you could integrate Twitter specifically. Twitter is currently the poster child for open web service APIs. The Twitter API is well documented and easy to use. In addition, it has tons of features. All of this makes integrating your Twitter activities with your WordPress installation a breeze. As such, there are several things you can do with Twitter integration. For example, you can show your...

Create an Options Page

WordPress 2.7 introduced a new Settings API that you will be using for all of the option methods you use in this section. The Settings API is a powerful set of functions to help make saving options in WordPress easy and secure. One of the major benefits of the Settings API is that WordPress handles the security checks, meaning you don't need to include a nonce in your form. The first option page method you'll explore is creating a unique option page for your top-level menu. Remember that when...

Simple Database Queries

When using the wpdb class, you must first define wpdb as a global variable before it will be available for use. To do so just drop this line of code directly preceding any wpdb function call One of the most important functions in the wpdb class is the prepare function. This function is used for escaping variables passed to your SQL queries. This is a critical step in preventing SQL injection attacks on your web site. All queries should be passed through the prepare function before being...

Creating Custom Tables

WordPress contains a variety of tables in which to store your plugin data. However, you might find that your plugin needs a custom table or two to store plugin data. This can be useful for more complex plugins such as an e-commerce plugin which would need to store order history, product and inventory data, and other data that is accessed using database SQL semantics rather than the simple key and value pairing of the options table. The first step in creating a custom database table is to create...

Create a Meta

WordPress features multiple meta boxes on the add new post, page, and link screens. These meta boxes are used for adding additional information to your posts and pages. Meta boxes can be created in a plugin using the add_meta_box function in WordPress. This function accepts six parameters as shown here < php add_meta_box( id, title, callback, page, context, priority ) > Each parameter helps define where and how your meta box is displayed. > id The CSS ID attribute for the meta box >...

Understanding The Loop

Understanding how the Loop functions will help you understand how you can control it. Controlling the Loop to display exactly the content you want will be one of your most used tools in developing WordPress-powered web sites. Because the Loop is at the heart of every WordPress theme, being able to customize the display content opens up the doors to making WordPress look and act however you want. To understand the Loop, it helps to break down the steps WordPress takes to generate a page's...

Showing Only One Category Categoryphp

The category.php template creates a loop of posts from only a specific category. The category template is invoked when a visitor hits a specific URL with the category name in it. This could be something like http example.com category ponies. In the category.php template, WordPress has already determined that your visitor is looking for posts in the particular category requests, so the default loop automatically makes this query for you, no special interaction...

Moving Authors And Users

Most brochureware web sites are author agnostic. That is, you do not really have content attributed to specific site authors, because they are representing a business entity. You can continue with this method, even when using WordPress, which enforces authorship. All you need to do is turn off the author information in your theme. However, if you are moving from a site that has authorship ingrained, or this is something you want to implement on the new site, you will need to set up your authors...

Performance Tuning

Securing and tuning your WordPress installation was covered back in Chapter 11. Be sure to review that content.We're going to touch on more enterprise-specific issues here, with the assumption that in an corporate technology deployment, you'll have access to the web, database, and file servers that comprise the bulk of your WordPress installation. Tuning your theme should be part of any theme development process. That process includes checking the file sizes of all images, making sure the...

Show Your Older Posts by Date Archivephp

Eventually, if you are diligent, your site will have older content. And if you are really industrious you will be able to do those fun one year ago on my site I told you about X'' posts. Eventually you may have copious amounts of content, and so much that it is not feasible or appealing to show it all on the front page. That is, if content is being generated on a regular schedule, there will come a point in time where you will want to refer to something that is clearly not going to be still on...

Word Press News Sites

Many different WordPress-related web sites exist. This section provides a list of the most popular WordPress-focused sites for news and information regarding anything and everything WordPress related. The WordPress Tavern is a web site focused on all things WordPress. This includes BuddyPress, bbPress, WordPress.com, and any project under the Automattic umbrella. The Tavern features a very active message board where members discuss the latest news and developments in the WordPress Community....

Theme218 Wordpress Shop

Action hooks, 127-132 Active Directory AD , 324-325 AD. See Active Directory additional hardware. See hardware, addition of admin accounts, 289-290 administrators, 34 WordPress role system, 296 advertising, of content, 242-247 monetization, 242-243 pay-per-click model, 243 pay-per-day model, 243 pay-per-view model, 243 setup, 243-247 conflict resolution, 246-247 editorial control, 244 manual placement, 245-246 plugins, 243-244 Akismet, 32-33 automated spam detection, 287 All Things D, 3 Allow...

Using Your Custom Taxonomy

Now that you've created your custom taxonomy you need to know how to use it on your web site. As always, WordPress features some very easy-to-use functions for working with your custom taxonomy. The following shows how you can display a tag cloud showing your custom taxonomy terms lt php wp_tag_cloud array 'taxonomy' gt 'ingredients', 'number' gt 5 gt The wp_tag_cloud function can accept a lot of different arguments, but in this example you're only using two taxonomy and number. First, you set...

Uninstall Your Plugin

A nice feature to include with your plugin is an uninstall feature. WordPress features two ways to register the uninstaller for your plugin the uninstall.php method and the uninstall hook. Both methods are executed when a deactivated plugin is deleted in WordPress. The first method you'll look at is the uninstall.php uninstaller method. This is the preferred method for uninstalling a plugin. The first step to using this method is to create an uninstall.php file. This file must exist in the root...