‘HOW-TO’ Category

Exporting-Importing A Category

23
responses

When it comes to exporting, WordPress already does a wonderful job with it’s support to export posts, pages, comments, custom fields, categories, and tags. However, there is a problem. The WordPress exporter lacks granularity. What I mean by this is that, the exporter covers the entire blog instead of being able to select certain categories to export. I’ve searched the WordPress Plugin database high and low to look for a plugin that would specifically export categories and I could not find one. I did manage to come across two techniques though that get the job done. There are two ways to export specific categories. The first is to read this forum post where HandySolo explains how to use the category RSS feed to export specific categories from a self hosted blog to a WordPress.com blog. The problem with this method is that, none of the meta data attached to the […]

[Continue Reading...]

Paging and Custom WordPress Loops

94
responses
by
on
April 19th, 2008
in
HOW-TO, WordPress FAQs, WordPress Hack

Last week I published two articles using custom loops. The first was about how to create a custom loop. The second was how to retrieve posts based on custom fields. In both articles, several readers commented that they would like to see paging and have it explained. I’d like to thank Aaron Harun from Anthology of Ideas for supplying the code used in this post. Paging, and why it doesn’t work with WP_Query The paging magic happens in a file called ‘link-template.php‘ in the ‘wp-includes‘ folder. Most themes have basic paging built in, with the help of two functions: next_posts_link and previous_posts_link. These functions, as well as several others, make use of a global variable called $wp_query. This variable is actually an instance of the WP_Query object. However, when we create our own instantiation of WP_Query, we don’t have this global variable $wp_query, which is why paging will not work. […]

[Continue Reading...]

How to Only Retrieve Posts With Custom Fields

32
responses

One question I come across a lot regarding custom fields is how to only retrieve posts based on a custom field. For example, if a post has a custom field of “MyData”, someone might want to only retrieve that particular post. The WordPress Codex has a technique for retrieving posts based on custom fields, which consists of writing your own query and going through the results. The technique in the Codex is good, but I’ve found a re-usable way one can retrieve only posts with certain custom fields. The technique I use makes use of two custom functions placed in a theme’s “functions.php” and a custom WordPress Loop. Let’s get started — The “functions.php” file First, let’s place the two custom functions in the “functions.php” file. This file should be in your theme directory, but if it isn’t there, you can create one using any text editor. Here are the […]

[Continue Reading...]

Define Your Own WordPress Loop Using WP_Query

78
responses
by
on
April 13th, 2008
in
HOW-TO, WordPress FAQs, WordPress Hack

We all know what the WordPress Loop is right? If not, there are many great tutorials around the web that explain the WordPress Loop. One of the easiest ways to navigate and manipulate the loop is to use the function called query_posts. Nathan Rice calls it a WordPress developers best friend. When you use query_posts, however, you risk the following: Potential to interfere with plugins which make use of the Loop. Potential to invalidate WordPress conditional tags. Having to deal with resetting, rewinding, offsetting… I say skip query_posts. In a way you’ll still be using it, but the better (and sometimes easier) technique is to instantiate your own WP_Query object and create your own loop. Creating Your Own Loop With WP_Query The first step is to instantiate your own variable using the WP_Query class. What we’ll be doing in this example is creating a common feature on blogs, which is […]

[Continue Reading...]

Managing Trackbacks and Pingbacks in Your WordPress Theme

43
responses

With all of the recent discussion regarding trackbacks and pingbacks on Weblog Tools Collection, I thought I’d mention several ways one can deal with trackbacks and pingbacks in the context of a WordPress theme. The topics I will be covering in this article are on separating trackbacks/pingbacks from regular comments, and also how to remove trackbacks and pingbacks from a WordPress theme completely. Separating Trackbacks/Pingbacks From Comments I know what you’re thinking: numerous posts have already been written on how to separate trackbacks from comments. But what I present here is an actual separation using the “functions.php” feature for WordPress themes along with the regular “comments.php“. Both should be located in your theme directory. Figure 1: Theme Directory Setup Modifying the functions.php File The “functions.php” file is a lifesaver for any theme developer or tinkerer wishing to add custom code or functions to themes. The code in the “functions.php” file […]

[Continue Reading...]

Add WP Search Engines To FF

8
responses
by
on
March 4th, 2008
in
HOW-TO, WordPress Tips

Jeremy Clarke mentioned to me about a way to search the Codex, WordPress support area and the plugin repository all from within FireFox. If you support users as I do in the WordPress IRC chat room, there are a lot of times where I do a search on the Codex to look up the page for a certain function that someone is inquiring about. Thanks to Jeremy’s tip, I no longer have to visit the actual page to perform a search. If you visit the MyCroft page on Mozdev.org you’ll notice a number of links that you can click on. Each one of these links are a search engine plugin that was coded for FireFox. What this means is that, you can add WordPress specific search engines to the search engine tool bar within FireFox which is usually occupied by Google by default. In order to install a SE plugin, […]

[Continue Reading...]

Gravatars and WordPress 2.5

98
responses
by
on
March 3rd, 2008
in
HOW-TO, WordPress

Several commenters mentioned on yesterday’s post regarding Gravatars without a plugin that WordPress 2.5 would be having built-in Gravatar support. And indeed WordPress 2.5 will come with Gravatar (aka, Avatar) support. Within this post I will demonstrate how Gravatars will be used with WordPress 2.5. As a side note, 2.5 has yet to be released as of this writing. Gravatars in the WordPress Admin Panel WordPress 2.5 marries theme authors and casual WordPress users together with support for Gravatars in the WordPress admin panel. WordPress users can access the Gravatars settings in the Settings->Discussion panel. If a theme author has decided to use the WordPress 2.5 function, then WordPress users can easily control their Gravatar usage in the admin panel. In the admin panel, WordPress users can change: Whether Avatars (aka, Gravatars) are displayed or not. Which rating of Avatars are shown. Avatars in the WP Admin Panel Please keep […]

[Continue Reading...]

Adding Your Plugin to WP Extend Plugins With a Mac

7
responses
by
on
February 9th, 2008
in
HOW-TO, WordPress FAQs, WordPress Plugins

A while back I wrote about listing your plugin to the official WordPress plugins directory. The tutorial was for windows and I have been on the look-out for a Mac version. Since I have been unable to find one, I will present to you a step-by-step tutorial on how to add and modify your WordPress Plugin using a Mac. To begin this tutorial, I first have to make some assumptions. My Assumptions Your plugin has already been approved over at WP Extend Plugins. You are running at least OSX Tiger You have WordPress locally installed. If not, please read Jeff’s tutorial on installing WordPress locally. You already have Subversion installed. If not, here’s a good tutorial on installing Subversion on a Mac. If you have Leopard, Subversion is already installed. You have downloaded and installed svnX. svnX has a nice GUI for those who don’t like to use Terminal commands. […]

[Continue Reading...]

Plugin Authors: Organize Bug Reports and Feature Requests Using the WordPress Plugin Repository

18
responses
by
on
January 18th, 2008
in
HOW-TO, WordPress FAQs, WordPress Plugins

One of the downsides of having a popular plugin is the amount of support requests, bug reports, and feature suggestions that come in. Well, it’s not that bad, but sometimes it’s difficult to organize what features should be added, what bugs must be tackled first, and what can just be ignored. If you’re one of the few and the proud over at WP Extend Plugins, you have a nice tool at your disposal to keep track of all your plugin related needs. The tool, you ask? It’s the trac ticketing system over at the WordPress Plugin Repository. WordPress Plugin Repository WordPress Plugin Repository – Trac Each plugin hosted on WP Extend allows the plugin author to post and assign tickets to their plugin. In fact, any member of the WP Support Forums can post a ticket against any plugin hosted in the official repository. Logging into the WP Plugins Repository […]

[Continue Reading...]



Obviously Powered by WordPress. © 2003-2013

css.php