WordPress: 20 answers

... to 20 questions, in alphabetical order.

How do I...

  1. Add a category link to the navigation bar?
  2. Add a favicon to my site?
  3. Add a Home link to the navigation bar?
  4. Add CSS or JavaScript to individual pages/posts?
  5. Back up my WordPress data?
  6. Change default category?
  7. Change fonts/colours/layout in my theme?
  8. Delay the delivery of my feeds...
  9. Disable the visual editor? (WYSIWYG)
  10. Exclude a page from the navigation bar?
  11. Find good WordPress themes?
  12. Make a post stick to the front page? (Sticky)
  13. Make links open in a new window?
  14. Make my WordPress site faster?
  15. Optimize my site for search engines? (SEO)
  16. Show more/fewer posts in archives/searches etc.?
  17. Stay updated of simple solutions for WordPress?
  18. Tag pages and have pages appear in tag results?
  19. Use “asides” or “miniposts” in my blog?
  20. Use PHP code in my posts and pages?

Top

  1. Install and activate Page Links to
  2. Make a new page with the title you want to appear on the menu. (The page does not need to have content, and its permalink doesn’t matter.)
  3. Scroll down and enter the URL for the category you want to link to —e.g., http://example.net/category/food/— in the “Point to this URL” box
  4. Scroll up and click Save

2. How do I add a favicon to my site?

Top

What is a favicon? — The tiny website icon/logo displayed in the location bar, bookmarks, and tabs of modern browsers.

  1. Make a 16x16 icon.
  2. Convert it to the ICO format:
  3. Make sure it is named favicon.ico
  4. Upload it to the home directory of your site. E.g.: http://op111.net/favicon.ico
  5. Install and activate Extended Options
  6. Go to Dashboard, Settings, Extended, Favicon Meta Links
  7. Select “Favicon in root directory”
  8. Scroll down and click Save Changes

Extended Options plugin for WordPress, drop-down menu to define favicon.

Top

4. How do I add CSS or JavaScript to individual pages/posts?

Top

  1. Install and activate HeadSpace2
  2. Go to Dashboard, Settings, Headspace, Page Modules
  3. Enable the module you need, JavaScript or Stylesheets, if it is not enabled (by default both are, under Advanced)
  4. Go to any page or post
  5. Scroll down to: HeadSpace Meta data
  6. Click “advanced” to reveal advanced modules
  7. Link your stylesheet or JavaScript file
  8. Scroll up again and click Save

Alternatively, you can enter CSS or JavaScript as “Raw data” — this module is not enabled by default:

HeadSpace2 plugin, module “Raw data”.

5. How do I back up my WordPress data?

Top

Many hosts do this automatically. To do it yourself, you need to know where your data are.

A. Database. — The database stores all text —posts, pages, comments, tags, etc.— and all settings of plugins and of WordPress itself. There are many ways to back up a database, and there is also a convenient plugin: WordPress Database Backup. After installing it, you can make copies of your database on demand, and/or set it to send copies to an e-mail address at regular intervals.

B. wp-content/uploads. — This directory has all files you upload. If your host has cPanel, you can use this to make copies. You can also use an FTP client: connect to your FTP account, navigate to the directory wp-content, and download the directory uploads to your computer.

FireFTP extension for Firefox.  Downloading the directory wp-content/uploads.

I connected to my FTP account with FireFTP, and navigated to the directory wp-content. I’m about to download the directory uploads. It has all images I upload, and also thumbnails generated automatically by WordPress.

6. How do I change default category?

Top

  1. Make a category to use as default (I use “Misc”)
  2. Go to Dashboard, Settings, Writing, Default Post Category
  3. Select your default category
  4. Scroll down and click Save Changes

Wordpress Dashboard, Settings, Writing.  Drop-down menu for Default Post Category.

7. How do I change fonts/colours/layout in my theme?

Top

If your theme doesn’t have options (few do), make a “child theme” and add your changes to it. It’s easy!

8. How do I delay the delivery of my feeds...

Top

... so that I don’t get embarrassed by stupid mistakes that I catch right after I click Publish?

Feed Pauser is a young plugin, still in beta, but I’m keeping an eye on it. :-)

9. How do I disable the visual editor? (WYSIWYG)

Top

That’s easy but sometimes you miss it. :-) In your profile, unselect “Use the visual editor when writing”:

WordPress, profile.  Option to disable the visual editor.

10. How do I exclude a page from the navigation bar?

Top

Install and activate “Exclude Pages”. It will add an option to not include individual pages in the nagivation bar and in other user menus, like the Pages widget.

WordPress, Dashboard, Edit Page.  Option to not include page in user menus.

11. How do I find good WordPress themes?

Top

I can suggest eight:

12. How do I make a post stick to the front page? (Sticky)

Top

Is this urgent? If you can wait, it will be part of WordPress 2.7, scheduled for November 2008:

WordPress 2.7, Dashboard, Write Post. Option to stick post to the front page.

13. How do I make links open in a new window?

Top

I believe visitors can do that for themselves, if they want. :-)

Firefox for Linux.  Context menu item to open link in new page.

14. How do I make my WordPress site faster?

Top

  • Remove plugins you don’t use or need.
  • Compress your images: smush it!
  • Compress everything! This is done server-side, but at least you can check with your host or see for yourself whether your server uses compression: YSlow
  • Use WP Super Cache — a plugin that caches the dynamic PHP output of WordPress to static HTML pages, which are served much faster.
  • Move to a faster server.

More can be done to accelerate a site, but most of it is the business of the server administrator (and, in the case of WordPress, of WordPress developers and plugin developers). If you think your site is too slow, run YSlow to check. Its reports are always interesting. Here’s is what I found recently by running YSlow on a WordPress site that is always very slow when I visit it with empty cache. (I removed the site’s address.)

YSlow extension for Firefox.  Part of report for slow site.

A long list of JavaScript files served uncompressed... The largest is Prototype, the JavaScript framework. Let’s see what would be the gain of compressing and minifying prototype.js:

Minification is the process of removing bits essential to humans but unneeded for execution, such as comments, white space, and line breaks.

prototype.js                        124 kB
prototype.js minified                72 kB
prototype.js gzipped                 28 kB
prototype.js gzipped & minified      21 kB

That’s right! The numbers are not fictitious! Since prototype.js is a large file, the gain in absolute size is impressive. But even for smaller files, numbers add up and the difference is felt by new visitors (whose browsers don’t have the files cached), even on fast connections.

15. How do I optimize my site for search engines? (SEO)

Top

Optimize it for humans, and it will be optimal for engines too:

  1. Publish good material.
  2. Publish good material well! Standards for online content authors
  3. Link to good material.

OK, maybe that’s not the complete truth, :-) but it’s the truest you can get in a short answer. To quote Michael Torbert, maintainer of “All in One SEO Pack”, the most popular WordPress plugin currently:

The biggest thing, of course, for SEO [...] is content. That will never change and it’s become increasingly, more and more important [...] as the search engines get better and better determining what is on your page and parsing through all that data. So, having good content is the key.

Michael Torbert, AKA hallsofmontezuma, in: “All In One SEO To Go”, 11 October 2008. Podcast. “WordPress Weekly episode 24”. 32:15–32:36. weblogtoolscollection.com/archives/2008/10/11/all-in-one-seo-to-go — Also interesting reading, from the original author of All in One SEO Pack: Modern Day SEO - What Really Counts

All that said, search engines can always use a little help to index a website better. There are two very popular WordPress plugins people use for this.

“Google (XML) Sitemaps Generator for WordPress” is a must-have. It automates the generation of an XML sitemap, a document recommended by the search companies themselves.

An XML sitemap tells web crawlers (also known as “spiders”, “robots” or just “bots”) where to find the content to be indexed. So, everything is indexed, even pages with no links, internal or external, pointing to them. An XML sitemap helps crawlers in other ways too. For instance, when a crawler sees the same content repeated in the home page and in the permalink of an individual post, it does not have to work too hard to decide which to give more weight to: it just looks at the XML sitemap, and learns that the main and permanent location is the permalink.

XML sitemaps and sitemap pages in websites are DIFFERENT things. The former are unstyled XML documents meant for web crawlers. The latter provide an index, an overview of the site’s content, for human visitors.

“All in One SEO Pack”, the other very popular SEO plugin, does various kinds of optimization. One is similar in purpose to XML sitemaps: It adds noindex tags (“do not index this”) to pages that duplicate content (category pages, tag pages, etc.), so that crawlers can work better.

It can also rewrite page titles, add meta descriptions, and more — see its page for details.

As far as I understand (not very far), the benefit of such optimizations is difficult to measure (the variables are too many), but, in any case, “All in One SEO Pack” can do no harm.

Both plugins work fine in their default settings. Just install and activate.

16. How do I show more/fewer posts in archives/searches etc.?

Top

  1. Install and activate HeadSpace2
  2. Go to Dashboard, Settings, Headspace, Site Modules
  3. Click the Edit icon next to “Page Counts” and enter your values
  4. Tick the box to activate the module

HeadSpace2 plugin for WordPress.  Module for number of posts in archives and searches.

17. How do I stay updated of simple solutions for WordPress?

Top

May I suggest:

18. How do I tag pages and have pages appear in tag results?

Top

  1. Install and activate HeadSpace2
  2. Go to Dashboard, Settings, Headspace, Page Modules
  3. Make sure the Tags module is enabled
  4. Tick “Pages appear in tag archives”

19. How do I use “asides” or “miniposts” in my blog?

Top

What are “asides”? — Short posts displayed differently than the rest.

20. How do I use PHP code in my posts and pages?

Top

  • Exec-PHP — executes PHP code in your posts, pages, and text widgets

A few tips that may save you trouble or troubleshooting when using Exec-PHP (all from the detailed documentation):

  1. In your profile, disable the visual editor
  2. In Dashboard, Settings, Writing, unselect “WordPress should correct invalidly nested XHTML automatically”
  3. By default only code by the admin is executed — but see no. 4:
  4. Read the Security Information in Dashboard, Settings, Exec-PHP

Notes

My thanks to Philip for his help.

And my thanks to you for visiting op111.net! — For any suggestions, corrections, questions etc., feel free to post a comment. You are most welcome.

Responses (7)

Pingbacks (3)

  1. [...] WordPress: 20 answers – op111.net. [...]

  2. [...] WordPress: 20 answers – op111.net Tags: faq, [...]

  3. [...] WordPress: 20 answers – op111.net (tags: wordpress faq tips list) [...]

Comments (4)

  1. Hanna says:

    Splendid tutorial (again!). Thank you very much. I follow your blog and look forward to the next tips. (I personally use Options theme right now: http://themehybrid.com/themes/options
    It is also very well written (as Thematic and Sandpress) and takes care of many “headaches”). Having said that – thank you especially for tip no 19 and HeadSpace – I will try it out for sure!

  2. demetris says:

    Thanks, Hanna! Glad you liked the mini how-tos.

    I agree about Options. I think all themes by ThemeHybrid are good. I tried Structure recently, and I liked it too.

  3. A really useful Tutorial! It was chosen for the home page of http://www.tutorialsroom.com
    Please submit all of your future quality tutorials in there.

  4. Chris ward says:

    Great tutorial, i’m a web developer and have been building sites using drupal but a friend told me to try wordpress, it can be used for much more then a blog which seems to be it’s main target audience. It’s a lot easier to modify then other cms.

Write a comment

Your email address will not be published. Required fields are marked *