How to Create a WordPress Shortcode that Only prints CSS for Certain Posts, Pages or Attachments
This morning, I found myself converting a WordPress Page Template into a plugin when I found myself limited by the WordPress Shortcode API. “Limited?” you ask. “The WordPress Shortcode API is awesome and easy to use… how could you possibly feel limited?” Well, I ran into a problem, but I found a solution… go easy, man… go easy…
Bulk Image Resize Utility Video
I’ve been working on a new plugin for WordPress which enables users to update all of their uploaded images after they have changed the Media Settings for their installation. The Bulk Image Resize Utility is currently in the beta stages of development and I would like your input on it’s usability. If you have a minute or two, please download the plugin and take it for a test run on your development server.
TEMPLATEPATH for Child Themes
So, the topic of this month’s Portland Wordpress User’s Group is “Child Themes”. I’ve never really utilized this functionality of WordPress until a few days ago when I worked support into The Platypus Theme.
One thing that I noticed was that the value of the constant TEMPLATEPATH always points to the “parent” theme. Which, after some thought, is to be expected. However, I was left wondering, How do I access custom files that I have put inside my child theme’s folder?
After some digging around in the core, I was able to piece together this solution:
$themes = get_themes(); $current_theme_name = get_current_theme(); $current_theme = $themes[ $current_theme_name ]; $templatepath = WP_CONTENT_DIR . $current_theme['Stylesheet Dir'];
Here, we have defined the variable $templatepath which we can use to find the path to any custom file in our child theme.
Hope this is useful to someone.
Please note, this solution will only work on versions of WordPress 2.6 or greater.
Text-based Image Links – No Longer Needed
I was recently looking through the WordPress Codex when I stumbled upon the pages for the following two functions: previous_image_link() & next_image_link().
These functions control previous and next navigation while a user is viewing an image attachment’s page. Up until now, these functions would only allow a thumbnail preview of the previous or next page. This was rather annoying to myself and other users so I created this plugin which allows a user to specify text alternatives to the default image links.
(more…)
Posts By Tag Plugin
Isn’t open-source software great? I think so. I recently found the Posts By Tag Plugin by Sudar Muthu which provides a sidebar widget which can be configured to display posts from a set of tags in the sidebar
. The plugin did exactly what I needed, except provide the ability to sort the posts. In a blogging/News environment users will usually want their posts to be sorted in descending order, but a situation arose where I needed my posts sorted in ascending order. Unfortunately, the plugin did not support this feature.
So, I dove into the plugins’ source code and added the functionality to sort the posts in either ascending or descending order. I emailed Sudar the modified file and he integrated the changes in the newest release of the plugin.
Awesome!
You can download the plugin here.
You can read Sudar’s post about the changes here.
Text Based Image Links 1.2
I just released an new version (1.2) of my Text Based Image Links WordPress plugin. The new version, offers more flexibility than the previous version allowing users to add custom class, id and title attributes to the links it generates. In case you have no idea what this plugin does or why you absolutely have to have it, visit it’s new home in the WordPress Plugin Directory.
Alphabetical Tags
I recently answered a thread in the WordPress support forums where someone was wondering how they could set up a tags page where their tags would be grouped by first letter. I posted the solution there as well as here. Hope someone finds the useful.
(more…)
Add Default Images to Many Popular Magazine Style Themes
I have recently answered a couple of questions in the WordPress Support Forums dealing with adding default thumbnails to posts in a few “magazine style” themes. These themes have been really popular for as long as I can remember and they all seem to have a similar method for displaying thumbnails next to a post excerpt on the theme’s front page.
Redirect Users to Homepage Instead of Dashboard after Logging into WordPress
Sick of having your blog’s users sent to the Dashboard after they log in? Here’s a quick way to redirect all registered users to your blog’s homepage. Just add the following code to your theme’s functions.php file.
<?php
add_filter( 'login_redirect', 'mf_redirect_login' );
function mf_redirect_login( $c ) {
return get_bloginfo( 'url' );
}
?>
WordPress: How to create a separate page for your blog posts while using a static homepage.
In a default installation of WordPress, the Front Page will display a list of all published posts sorted in descending order by “Post Date”. This works great if you want your WordPress installation to function as a “blog”, but what do you do if you want your installation to function as a “website” with a “blog” inside it? Fortunately, this functionality is built into WordPress and only takes a few minutes to get up and running. Please read below for instructions. This tutorial assumes that you are using a fresh installation of WordPress (installed at “web root”) with the default theme. Don’t fret if this is not your current situation, the instruction below will work on any WordPress blog… you just might need to do a bit of work depending on the theme you are using :)
Adding text links to WordPress Gallery
Another WordPress tutorial!!!
Andy from Tokyo, Japan writes in asking:
Could you please tell me how you added the text navigation links to your gallery? I would be grateful… …Thank you.
Sure Andy, No problem, but first a little bit of background for everyone else:
How to Activate Excerpts for Pages in Wordpress Admin Panel
I always wondered why wordpress allowed excerpts for posts and not for pages. A bit odd considering that both posts and pages are stored in the same database table and can have the same values stored for them. I have found a rather nice work around for this in 2.3.3 and then came…….. Wordpress 2.5!

