Ask the WordPress Guru, Q&A #1

Here is the first Q&A session I called 'Ask a WordPress Guru'. I will try to hold these sessions periodically and the goal is to help both webmasters just starting out with WordPress and experienced developers.

Questions and Answers

I want to change what widgets are in the right sidebar of a theme.  Right now it displays a calendar and a tag cloud.  When i go to widgets and edit the right sidebar it says there are none there.  Were do I go to make the changes?

When you go to widgets and edit right sidebar you have the ability to 'drag and drop' widgets which are listed in the list on the left side. By Dragging these widgets (remember to save changes) you enable them on your blog.

Any chance you can tell me how to exclude a category from Snazzy archives (PHP is familiar)?

To do this you would need to modify the plugin and skip posts that belong to the given category. You can see example function called in_category() found in wp-includes/category-template.php to get a general idea how it works.

When/why would some folks use categories vs pages to layout a WordPress site/blog (e.g. company website static pages and a blog)? I noticed some WordPress templates are tied to categories + subcategories while others are tied to pages + sub-pages.

Categories and Pages are two different structures. One of the main differences is what WordPress allows you to do with them. Categories are good for grouping posts of similar nature. Pages are good for pointing out static content.

Check my structure for example. Categories are WordPress, SEO etc. Static pages are WordPress Plugins and then each plugin.

I was wondering about themes, specifically Blue Grace and Amazing Grace. I currently use Amazing Grace on my site and love it.  I have modified the styling a bit.  I was wondering with any new version of Amazing or Blue Grace, what files do I need to upgrade functionality to themes?  What files should I retain (I think CSS is one).  I was just wondering about new code that you may have implemented and how I could possibly destroy a theme I already have up by making incorrect changes.

The only way to this correctly is to use a file compare tool which will tell you exactly where the differences between two files (in your theme and in the new version) are. I use exactly this method for my needs (and a tool called Total Commander which includes powerful file compare utility).

I would just turn off the sidebar in a few pages of my website. Can be done? For example in the photo gallery page.

Of course it is. You need to find call to get_sidebar() in your theme template (usually in footer.php and exclude it in certain cases. Here is actual snippet from my site.

<?php if (!is_page('forum') && !is_page('services') && !is_page('tags')) get_sidebar(); ?>

I am writing you because I had a blog in wordpress on a shared hosting. It was getting huge traffic and going smoothly. Suddenly I got reports from my host that my above site using too much CPU resources. I tried to find solution about this problem and did some changes but after few days it still did the same problem.

Shared hosting is usually not suitable for serving sites receiving huge traffic. There are optimization techniques you can try outlined in WordPress Optimization Bible article. I also recommend reading WordPress Hosting Recommendation.

I run a WP site and it's essentially a directory of rental properties. Users are using tdo mini forms to submit their properties, and the theme is pulling the submitted image thumbnail from the core into the excerpt and the full size image is displayed in single.php. Note that i'm not using custom fields for the thumbnails.  I've been trying to work out how to show a 'more from this category' list at the bottom of each single listing, with say 3 other properties from the same category with an image. I'd be happy to use the same thumbnail as the images, but none of the 'related posts, similar posts, or YARPP plugins seem to handle this well (even the beta of YARPP 3 doesn't have a template set up to do this).  Can you give me any pointers?

I do not quite understand your image setup, but if images are simply part of the posts, Similar Posts plugin should be able to extract and display them.

What is the best way to remove the "comments are closed" from pages like about us, contact  etc. These pages tend to have their comments closed and are expected to not allow for commentary so the additional bloated text at the bottom has always seemed as unnecessary to me. Would love to know some easy way to condition this out or what needs to be removed from having this displayed?

The message is displayed in comments.php and the simplest way is just to remove the message all together (search for it in the file and remove it). When you think about it, if there is no comment form to start from, the message becomes obsolete. That is how I handle it on my site.

How can you customize the "More" tag in WordPress.  I would like to have an icon instead of "[click to continue...]" when I create a post but I don't want to put the entire post on the home page.

More tag can be easily customized in WordPress.  Here is an example

<?php the_content(__('<span class="more">Text</span>'));?>

Or you can try Customizing_the_Read_More article from WP Codex, and there is even a plugin for this purpose.

I'm using the Blue Grace theme, and I'd like to know how to remove the RSS icon in the header. And in general, what do I look for to remove or add items to the header?

Simply remove the whole rss-big div from the header.php file (<div id="rss-big">...</div>). Generally to do any kind of CSS and HTML debugging I recommend getting used to Firebug, the greatest web developer tool there is.

Ok that's it for now, I hope you found this useful. See you in next Ask a WordPress Guru edition :)


More like this:


Posted in: WordPress
TAGS:, , , , , , , , , , , , , , ,
Both comments and trackbacks are currently closed.

4 Comments

  1. May 31st, 2009 4:23 PM

    I seem to be having a problem accessing a sub-directory inside the wordpress directory... really strange... can you help solve this issue?

    Here are2 webpages I made detailing changes that we want to make, and screenshots of the activity trying to access these folders via http://FTP... but can't, due to the inability to access a folder called 'blueggrace' in the directory called...

    http://www.dalligold.com/blog/wp-content/themes/ VIA FTP!

    I can see the directory 'blueggrace' via explorer and firefox browsers, but WS_FTP_LE, AceFTP AND FireFTP CANNOT see the folder 'blueggrace' in the

    http://www.dalligold.com/blog/wp-content/themes/

    folder...

    View these 2 webpages to see what we are trying to do AND screenshots of both FTP and Browser access attempts for the 'blueggrace' folder!

    http://committeetorestoretheusconstitution.com/Dalli/DalliLogo.html

    and the screenshots at...

    http://committeetorestoretheusconstitution.com/Dalli/index_2.html

    I have over 12 years experience with computers, FTP and browser management and USE and I have NEVER run across the inability to access a subfolder with FTP Apps, but can SEE, and DOWNLOAD files WITHIN a folder via BROWSER... It's stranger than fiction!

  2. Mar 28th, 2009 9:10 PM

    Thanks for your answers. Interesting as always. I'm using your Blue Grace theme and my tool of choice for any file comparism and update jobs is WinMerge. It's open source and highly recommended.

  3. Mar 20th, 2009 4:23 PM

    Regarding this question and answer:

    I would just turn off the sidebar in a few pages of my website. Can be done? For example in the photo gallery page.

    Of course it is. You need to find call to get_sidebar() in your theme template (usually in footer.php and exclude it in certain cases. Here is actual snippet from my site.

    I would also suggest creating a Page Template that has no sidebar. That way, when creating a page, you simply choose the Page Template with no sidebar. This avoids editing the theme files directly, so upgrades don't overwrite your custom changes.

    You can learn more about Page Templates here:
    http://justintadlock.com/archives/2009/03/13/page-templates-the-untapped-potential-of-wordpress

  4. Mar 20th, 2009 2:07 PM

    I posted on the support forums about the avatar bug, and the bug with images 'centered'. AG is not able to show images that have an alignment of 'center'. I have fixed these on my own blogs but it would be good if an update can be provided.