Read our latest blog posts, learn something new, find answers, and stay up to date.

Show Only Category (Not Subcategory) Content

If you ever wanted to only show the content of the category you were on in the category view of WordPress (instead of the category you are on plus all of it’s subcategories – you can easily do so by adding the code below to the template that is used to show your category content

You would start your loop with this:


Put your title, content functions here

and where you normally see the call, put to close the additional (in_category) if statement.

This code gets the current category and then only displays categories that are in that category (not sub category)

WordPress Import/Export Option

Not too long ago whenever I had to move clients from one server to another, I would make a backup of the files and the database and then use SSH or FTP to move the files and then import the SQL file into MySQL. Over the past few months – I have switched to using the Import/Export option(Manage > Import/Export) to move simple sites. If you are moving your site to/from or from another server, take a look at the Import/Export option in WordPress to easily move all your data and attachments.

The Import/Export Process

You first need to log into your current WordPress installation and export your existing site data so you can import it on your new host. To do this, go to the WordPress Admin > Manage > Export. WordPress will create an XML file that you will then use to import. This is a really quick and easy way to move from one host to another if you are not comfortable with MySQL or phpMyAdmin (or any other database tool).

Import all your data (Import posts, comments, custom fields, pages, and categories from a WordPress export file) into your new WordPress installation. You can even import all your attachments which makes this even easier to migrate from one host to another.

You will also need to move your plugins, theme files, and any other files you might have – but this is a really easy way for most to move their data from one site to another – and it works great!

SDAC Recommends: WP Plugin: NextGen Gallery

I get a lot of client requests for some sort of gallery plugin and it is clear to me now that the best gallery plugin for WordPress is: NextGen Gallery. The user interface is easy to use, the plugin is actively being developed, there are lots of options for the users, and it is a joy to work with. Out of the box it comes with a widget to load in recent or random images in your sidebar (or page) as well as an easy way to display single galleries or multiple galleries (albums). This is a must have for anyone who is looking for an elegant solution to display images.

WordPress Update: 2.5.1

WordPress 2.5.1 has officially been released. The new version includes over 70 bug fixes, performance enhancements, and an important security fix. For more information on WordPress version 2.5.1, read the official WordPress version 2.5.1 documentation.
Download the latest versions of WordPress: 2.5.1

WordPress 2.5 Common Questions and Answers

After upgrading a number of sites to WordPress 2.5 – the questions are pouring in over the new user interface and the new functionality. I have compiled a list of the top questions I have received so far.

  1. I am getting weird PHP errors on my pages, what is going on? I have been busy with a lot of these issues and mostly from people who have updated to WordPress 2.5 but did not update any of their plugins at the same time. During the installation process – do not forget to grab the latest version of your plugins as well.
  2. My thumbnails are squished – how do I make them look better? WordPress 2.5 allows you to set the size of your thumbnails as well as gives you a “medium” size image option. By default, WordPress uses this option: Crop thumbnail to exact dimensions (normally thumbnails are proportional). If you upload images that are not square – this will really make your thumbnails look squished. I would recommend un-checking this option. (Settings > Miscellaneous)
  3. How do I turn on/off Gravatar support? This setting is located at the bottom of the discussion setting page (Settings > Discussion)
  4. How can I link my images to a page (attachment) like I did in 2.3? If you want to link your images to a page with a bigger version of the image within your page template, you can do so by selecting “Post URL” in the “Link URL” field when uploading an image with the new media uploader. There is also a new template for this page – image.php. You can find an example template in the default theme.
  5. My comments are not visible in the WordPress admin – what can I do to fix this? I have found this to be an issue on some sites with really outdated versions of WordPress. By executing: create index comment_date_gmt on wp_comments(comment_date_gmt); on the WP database – I have found that that usually clears it up. (Thanks to the WordPress forum thread on this)
  6. What all changed? If you want a great overview (with a video) check out the WordPress blog post on WordPress 2.5

Hopefully these answers will help you with getting more comfortable with WordPress 2.5. There are a lot of big and small changes to this new version of WordPress and every day I use it – I like it more (and hope you do too).

WordPress 2.5 is Released

WordPress 2.5 has officially been released. The new version includes over 1300 changes (see full changelog) and a variety of new features. For more information on WordPress version 2.5, read the official WordPress version 2.5 documentation.
Download the latest versions of WordPress: WordPress 2.5

In addition to the new WordPress release, the web site has a fresh new look. Great work!

Things to Note with WordPress 2.5

After working with WordPress 2.5 on a few sites for the last few weeks, there are a few things I wanted to point out for people that will be soon making the jump to WordPress 2.5.

  • The dashboard is now customizable. You are now able to choose what feeds show up! If you would rather other news sources – you can easily change the feeds by entering a new feed URL.
  • The number of widgets you use is now unlimited.A lot of people wanted more than 9 RSS feed widgets, more than 9 text widgets, etc and now you can have as many as you would like.
  • Managing media just got easier. There is now great built in support for a “media library”. No more using multiple plugins for uploads – you now have all that functionality built in.
  • Updating your plugins just got easier. You can now update your plugins with a click of the button – but this means you will need to save your FTP user name and password and then trust that the updated plugin code is safe. While this is very handy and will save a lot of time for people not comfortable with FTP – the cost is security to some degree. I doubt I will use this personally – but I will also see how it plays out.
  • Choose your own thumbnail sizes.You can now set the size of your thumbnails (small and medium size options). This setting is under “Miscellaneous”.
  • Prototype library has been updated to version 1.6. If you are using any custom plugins that use Prototype or any custom template code that rely on Prototype – you might experience some issues if you are using an older version. Make sure everything you use is up to date. (I ran into this issue personally)
  • Gravatar functionality is now part of WordPress – no more plugins needed. Here is a quick way to implelement gravatar support in WordPress 2.5+ comments: In your comments.php file you can add in gravatar functionality by simply adding:

    before : That is it! You could also add gravatars to posts by putting the same code into the post loop to have the gravatar show per post author. (The number – in this example 40 – is the size of the gravatar)

Make sure you check out the screencast that Matt created which highlights the new 2.5 features.

SDAC Recommends: WordPress Plugin: WP Codeshield

So many of my clients love WordPress but hate the WYSIWYG editor.
The problem:
When users try to add content with HTML within the content – then go back to edit it, save it, and their custom HTML becomes a mess. For most – simply disabling the rich text editor (Users > User > uncheck “Use the visual editor when writing”) is good, but others like to use the editor except for a handful of posts or pages.

The solution:
Download and install WP Codeshield. This plugin will make sure that the rich text editor does not touch any custom HTML code within . All you need to do is wrap around your custom code and you can forget about any more issues with the rich text editor and any HTML you put in/edit.

*Note – if you put this in place and your outputted HTML text looks different than everything else (it is using a monospace font by default) – add : code {font-family:inherit} to your style sheet and the text will not look out of place.

New Condition Tag: is_front_page() (WordPress 2.5)

Great news for WordPress theme developers. WordPress 2.5 now offers a new conditional tag: is_front_page(). We have long lived with other options (is_page(‘home’)) or other logic like that, but the is_front_page() simplifies defining the “home page” in our templates. Thanks guys!