Archives

Category Archives: WordPress Tutorials

Add Scripts and Styles to Specific Admin Pages Only

jQuery, Tutorials, WordPress Tutorials4 comments

One very common mistake that is made by WordPress developers is failing to limit the environments in which their scripts are loaded, particularly in the admin section.

Continue Reading

Pass Parameters to query_posts and Keep Query Intact

Tutorials, Wordpress, WordPress Tutorials5 comments

When working with custom queries, as is quite common in theme development, you will often need to pass certain parameters to the query_posts() function, such as those to limit the category or the number of posts displayed. Continue Reading

Fix Broken Search Pagination in WordPress 3.1

Tutorials, Wordpress, WordPress Tutorials10 comments

This morning I spent several hours debugging a broken WordPress search pagination. The function itself worked fine, but when clicking over to any page, a 404 error was displayed. Unlike the usual culprit, a custom query_posts() function was not the problem here.
Continue Reading

Get Category Name from ID

Tutorials, Wordpress, WordPress Tutorials0 comments

WordPress has a nice little function get_cat_name() that allows us to retrieve the name of the category from the database by using the ID of the desired category.
Continue Reading

Get Featured Thumbnail URL

Tutorials, Wordpress, WordPress Tutorials2 comments

A lot of times it can be necessary to be able to obtain just the source URL of a post’s featured thumbnail.

Using the wp_get_attachment_image_src() function, we can obtain the URL of whatever image size we want:
Continue Reading

Get Page ID by Page Name

PHP, Tutorials, Wordpress, WordPress Tutorials1 comment

This is a wonderful little function was written by Web-Templates.nu, and allows you to find the ID of a page by using its name.
Continue Reading

Publish Action Hook for Custom Post Types

PHP, Tutorials, Wordpress, WordPress Tutorials12 comments

Most of the time, when a developer wants to make something happen every time a post is published, such as send out an email notification, they use
Continue Reading

Set Max Title Length on WordPress Posts

Tutorials, Wordpress, WordPress Tutorials11 comments

Similar to my earlier snippet that let us set a minimum word count for the post body, this bit of code will allow us to set a maximum word count to the post title.
Continue Reading

Check if Current Page is in Tree

Tutorials, Wordpress, WordPress Tutorials4 comments

This is a really useful little snippet I found in the WordPress Codex. It allows us to check whether a page is within a specified tree, e.g. whether a page is a certain ID or if it is a subpage of that ID.
Continue Reading

Minimum Word Count for WordPress Posts

Tutorials, Wordpress, WordPress Tutorials29 comments

If you wish to set a minimum word count for your posts (this can be useful for a variety of things, including maintaining a clean layout), simply add the following snippet to your functions.php file and set the number to whatever you wish.
Continue Reading

WordPress Plugin Toolbox

Plugins, Tutorials, Wordpress, WordPress Tutorials0 comments

WordPress puts a lot of really useful utilities in the plugin developer’s toolbox. I’m going to go through a few of them here.

These are especially useful if you’re just beginning WordPress plugin development.
Continue Reading

Stellar WordPress Portfolio Control with Custom Post / Meta Types

PHP, Tutorials, Wordpress, WordPress Tutorials53 comments

Wordpress 3.0 has introduced a lot of very powerful new features into the theme developer’s toolbox. The most exciting of these is probably the addition of custom post / meta types.
Continue Reading

Page 1 of 212