SDAC Blog

Check out our blog for WordPress updates, WordPress plugin reviews, and general web development hints.

hr
hr

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:

PHP:
<?php $cat = intval( get_query_var('cat') ); while (have_posts()) : the_post(); if (in_category($cat) ) : ?>

Put your title, content functions here

and where you normally see the

PHP:
<?php endwhile;?>

call, put

PHP:
<?php endif;endwhile; ?>

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)

separate
hr
hr

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 WordPress.com 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!

separate
hr
hr

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.

separate
hr
hr

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

separate
hr
hr

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).

separate