Using wp_cron to disable commenting on old posts

One of the little known, but incredibly useful functions of WordPress is wp_cron. It allows you to schedule tasks for execution at a later time, the tasks can also be repeatable. It's not perfect and does have one serious problem, in that it is only executed while users are actually navigating the site. But on a popular site this won't make a difference, but it's still worth noting. Something I see regularly been asked for is the ability to disable commenting on or delete/hide older posts, generally for...
read more

Adding an admin or settings page to WordPress

A few weeks ago in my Google Maps Shortcode for WordPress tutorial I covered how to create a basic shortcode. All of the settings required for the Google Maps API where included as configurable attributes for the shortcode. It was discussed in the comments that perhaps it would be better to set some of those options globally. One option discussed was modifying the wp-config.php file, this I don't think is a great idea. It would mean that it could be potentially overwritten by upgrades and is not easily...
read more

My favorite development tool set, keeping it simple

When I first started playing around with websites in the late nineties (wow, I feel old now) there wasn't much in the way of choice for development IDE's, there was really only Microsoft FrontPage and Macromedia (now Adobe) Dreamweaver. Being honest they weren't great, Dreamweaver's big claim to fame was that it generated cleaner html than FrontPage. Both where poor by today's standards, this was mainly because they where WYSIWYG editors, allowing even novices to create simple pages. When I went...
read more

Customizing WordPress Using Custom Post Types

One of WordPress' greatest features is its ability for customization. There are many sites out there that could benefit greatly from these features. I've seen sites that sell cars and houses to simple music sites that could benefit from one specific customization function within WordPress, the register_post_type. The register_post_type function, as its name suggests allow the user (or theme) to add a new post type such as car, house or album. Once this post type has been registered, the user can...
read more

Creating a jQuery gallery for Flickr

This week, we'll be creating a simple jQuery gallery that uses the Flickr API to retrieve a list of images from a photo set and display them. We'll also be using the API to get some additional information about the images and storing it using the HTML5 data-* attributes The Flickr API ... To use the API you need to register for an API key, it doesn't take long and you can start here There are 2 methods that we will be using for this tutorial, first we'll need to get name and description of the specified photo set....
read more

Creating a Google Maps shortcode for WordPress

This week we'll be extending WordPress by adding a custom shortcode. This shortcode will allow us to add a Google Map to a post using a simple piece of text in a post or page. Shortcodes are a quick and easy way to add functionality to a post in WordPress. They look something like this: [ gallery ids="1,2,3,4"] We'll also using PHP based Object Orientated Programming (OOP) to create our shortcode. We'll create a basic class, that has some static functions with in. We'll be using static methods because we...
read more

Creating a simple to-do application – Part 4

This week in part 4 of creating our simple to-do application we'll be learning how to send email notifications/reminders. To do this we'll be using the PHP mail method and learning how to schedule repeatable tasks on Linux using cron. The equivalent process for Windows is the task scheduler and it is pretty self explanatory. WordPress has what it calls the wp-cron alternative, but it's use is limited as it requires someone to actually use the site. Cron ... Cron is the Unix/Linux schedule process, it...
read more

Creating a simple jQuery plugin for Pinterest

Plugins play a great part in the success of jQuery. There are hundreds of them out there, and having the ability to create your own is a great skill to have. With all of the interest in Pinterest (no pun intended), I thought it would be a good idea to do up a quick and simple Pinterest sharing plugin for jQuery. Getting started ... First we need to grab the jQuery plugin boilerplate (function( $ ) { $.fn.pinterest = function(options) { var settings = $.extend( { }, options); return this.each(function() { });...
read more
Load more