Chapter 6. Jazzing Up Your Posts

You know what an ordinary WordPress post looks like—it starts with a title, followed by one or more paragraphs of text. And there’s nothing wrong with that. Providing that you pick the right theme, your WordPress site can look surprisingly hip, even if it holds nothing more than plain text.

However, there are plenty of types of sites that need more from a post. For example, if you’re posting news articles, you certainly want to add pictures. And if you’re writing long posts (on anything from business analytics to relationship advice), you’ll improve your audience’s reading experience if you use subheadings to structure your thoughts. To add details like these, along with lists, links, and the other accouterments of a web page, you need to take charge of WordPress’s post editor, which you’ll do in this chapter.

Fancy posts aren’t just about formatting—they’re also about features. For example, you can use specialized tags to show just a portion of a post on your home page (rather than the whole thing), giving you a ridiculously useful way to promote many posts in a small space. Or you can use images from your posts to create a slideshow that, say, promotes your top posts on the home page. In this chapter, you’ll use all these techniques to improve the aesthetics and showcase the richness of your site.

Making Fancier Posts

You’ve seen plenty of WordPress posts so far, but none are likely to impress your web designer friends. Fortunately, you don’t need to stick with the plain and ordinary. WordPress is packed with tools that can help you create epically formatted posts.

The easiest way to start styling your posts is to start with a new one (to do that, choose Posts→Add New, as usual). Then look at the toolbar that sits at the top of the editing box—it’s stocked with useful formatting commands (Figure 6-1).

Even though WordPress creates your posts using web-friendly HTML markup, the toolbar buttons work in almost the same way they do in a word processor, complete with a basic Undo feature. It’s like having a miniature Microsoft Word in your browser.

You can format your posts two ways. One is to select the bit of text that needs formatting and then click the corresponding toolbar button. You might, for example, select a single word and add bold formatting by clicking the B button. Another approach is to use the toolbar buttons to turn a feature on or off (which computer nerds call toggling) as you write. For example, you could click the I button to turn on italic formatting, type something, and then click the I button again to turn off italics.

The following sections explain a few of the finer points of post formatting. You’ll see the proper way to work with headings, add links and special characters, and unlock even more capabilities by editing your post’s HTML.

Every blog post starts with a heading—the title of your post, which sits above the post content. But if you’re writing a long post, it’s a good idea to subdivide your writing into smaller units using subheadings.

To create a subheading, use the drop-down Format menu on the far left of the second row of the toolbar (Figure 6-2). Usually, the menu displays the word “Paragraph,” which tells you that WordPress is styling the current text as an ordinary paragraph. But you can choose three sizes of heading from the menu, too.

The heading level you use depends, at least in part, on your theme. Here are some guidelines:

Special characters are usually defined as characters you don’t see on your everyday keyboard. For example, if you use a standard U.S. keyboard, special characters include things like accented letters and typographic symbols.

WordPress lets you drop in one of a small set of special characters using the Insert Custom Character command. Click it, and a window appears with a grid of unusual characters. Point to one to get a close-up look at it, and then click it to close the window and insert the character into your post (see Figure 6-5).

You may not need all the special characters you think you do. WordPress automatically substitutes special characters for some character combinations. For example, if you type two dashes (--) between words, WordPress turns them into a seamless en dash (–) when you publish the post. Three dashes in a row creates a slightly longer em dash (—). Similarly, WordPress turns ordinary straight quotes (“”) into typographically correct quotation marks (“”). It works the same magic with apostrophes.

Note

The oddest special characters you can use with WordPress are smilies, character combinations like :) that turn into emoticons like . WordPress performs this substitution automatically, and you can find out what smilies you can use (and the characters you need to type to trigger them) at http://tinyurl.com/using-smilies. On the other hand, if the smilies feature is running amok and changing character sequences you don’t want it to, choose Settings→Writing and turn off the checkbox next to “Convert emoticons like :-) and :-P to graphics on display.”

Using the HTML View

All the toolbar buttons you studied so far work by inserting the right HTML into your posts, behind the scenes. But if you’ve got a bit of web design experience, you don’t need to rely on the buttons. Using WordPress’s HTML view, you can directly edit your post’s HTML markup. You won’t be limited by the buttons in the toolbar—instead, you can enter any HTML element you want.

To switch to HTML view, click the Text tab that sits just above the post content box, on the right (Figure 6-6). To go back to the visual editor, click the Visual tab. In fact, there’s no reason you can’t spend time in both places. For example, you might write your post in the visual editor and then switch to HTML view to inspect the markup.

HTML view gives you a slightly different toolbar. It still has the useful “full screen” button, but most of the other shortcuts, which insert various HTML tags, aren’t much help—if you’re savvy enough to prefer the HTML view, then you probably want to type in your markup by hand.

If you’re a seasoned web designer, you might feel that WordPress’s HTML editor isn’t up to snuff. Full HTML editing programs like Adobe Dreamweaver are packed with little frills that can make editing easier—for example, they automatically add closing tags to HTML elements and suggest possible tag names as you type. (HTML editors also have more powerful layout and styling features, but those features make more sense when you’re designing the look and layout of an entire site, not just adding a bit of content to a post.)

Most WordPress developers don’t need the full features of a program like Dreamweaver. But there are exceptions. If you write long, complex posts—for example, the articles you saw in the Internet Encyclopedia of Philosophy (Other Types of WordPress Sites)—you probably don’t want to do all your editing in a web page window. Hardcore HTML lovers who find themselves in this situation can write posts in an HTML editor like Dreamweaver, copy the markup, and then paste it into WordPress’s Text content box. But don’t try this unless you really understand your markup. You don’t want to transfer a whack of formatting details to your WordPress post, like a <span> element that has hardcoded font settings. If you do, you’ll introduce some serious issues, including inconsistencies between posts and problems changing themes.

Most WordPress fans do their work directly in their web browsers, using the WordPress editor. But if you’re working with long documents and you’re missing your favorite conveniences, you have other options.

One is to upgrade your WordPress editor. This approach makes sense if you’re happy creating your posts in the familiar Add New Post web page but don’t feel like you’re getting enough help from WordPress. Using a plug-in, you can swap in an editor that has a bit more muscle. (Of course, you’ll need a self-hosted WordPress site to change your editor, because WordPress.com doesn’t let you add plug-ins.)

You can search for a pumped-up post editor on the WordPress plug-in page (http://wordpress.org/plugins), as explained in Chapter 9. Plenty of them offer advanced features like search-and-replace, style-based editing, and support for creating tables. One of the most popular is TinyMCE. Check it out at http://tinyurl.com/tinyeditor and learn about installing plug-ins on Searching for a Plug-In.

Another solution is to do your post-writing work in another program. You’ve already learned that you can paste in pure HTML using the WordPress editor’s HTML view (Using the HTML View), but this technique is a bit touchy—paste in the wrong markup and you can scramble your site. A better approach is to use a program that lets you compose rich content, and then posts that content to your site safely and cleanly, without an awkward cut-and-paste step.

On a Windows computer, you can use Microsoft’s free Windows Live Writer to compose properly formatted posts on your desktop, even if you don’t have an Internet connection. When you’re ready, a single click publishes the posts on your blog. Windows Live Writer is available free at http://tinyurl.com/win-essentials. Mac fiends can find similar blog-writing tools, including the popular—but, sadly, not free (it’s $40)—MarsEdit (www.red-sweater.com/marsedit).

Note

WordPress has a list of even more desktop post editors for Windows, Mac OS, and Linux at http://tinyurl.com/blog-client. Most offer handy formatting features, and all of them let you compose your work offline.

Finally, Microsoft Word lovers can use their favorite word processor to write WordPress posts using the little-known “Blog post” template. Word asks for your site’s URL, user name, and password, after which it lets you create new posts and edit old ones, all from the comfort of the Word window.

Adding Pictures

You’ve now toured many of the post-enhancing features the Add New Post page offers. But there are several frills you haven’t yet touched. The most obvious is adding graphics.

Virtually every good WordPress site can be made better with pictures. WordPress gives you several ways to do that, from the obvious (plopping them into your posts, alongside your text) to the more interesting (using them to build photoblogs, create slideshows, and advertise new posts on your home page). In the following sections, you’ll learn how to take advantage of these slick picture tricks.

The most obvious place for a picture is in a post, right along with your content. WordPress makes it easy to insert pictures as you create a post (on the Add New Post page) or edit one (on the Edit Post page). In fact, you can put as many images as you want into any post.

  1. In a post’s edit box, click the spot where you want to add a picture.

    It doesn’t matter whether you use the visual editor (the Visual tab) or the HTML editor (the Text tab). If you use the visual editor, you’ll see every picture you insert right next to your post text. If you use the HTML editor, you’ll see the raw HTML markup for each picture. This markup includes an <img> element for the picture, wrapped in an <a> anchor element that turns the picture into a link so readers can click it to see the full-size image, and possibly some other elements, like a title or a caption.

  2. Just above the box where you type in your content, click the Add Media button.

    The Insert Media window appears (Figure 6-7). It gives you three ways to find a picture: You can upload a file from your computer (using the Upload Files tab), use a file you already uploaded to WordPress’s media library (using the Media Library tab), or grab a file that’s stored on another website (by clicking the “Insert from URL” link on the left).

    In this example, you want to stick to the Upload Files tab. Grabbing pictures from other websites (using “Insert from URL”) might be worthwhile if you store graphics on another part of your site. But if it’s someone else’s site, don’t chance it—the risk that the picture is copyrighted, or that the webmaster could change or move it to a new address, is too great. The Media Library tab is also useful, but only after you build up a collection of pictures. You’ll take a look at it on Viewing the Media Library.

    Note

    The Insert Media window also has links for creating a picture gallery (Showing Groups of Pictures) and setting your post’s featured image (Featured Images). WordPress.com users will see even more links, for adding tweets and YouTube videos. Ignore all these details for now—you’ll revisit them soon enough.

  3. Pick the files you want to upload.

    WordPress gives you two options. The quickest approach is to drag files from an open file browser window (like Windows Explorer or the Mac’s Finder) and drop them in the Insert Media window box. You can drag as many files as you want, either all at once or one at a time, and you can keep dropping in new files before WordPress finishes uploading the old ones.

    Your other option is to pick your files from a standard dialog box. To do that, click the Select Files button, browse to the right folder, and then pick what you want. Ctrl-click (Command-click on a Mac) to select multiple files at once.

    Once you upload your files, WordPress switches to the Media Library tab, which lists all the images you ever added to your site. It puts new pictures at the top of the list.

    If your files are particularly large (or your web connection is particularly slow), you’ll see a progress bar ticking along, tracking the upload progress of each file. When WordPress finishes an upload, it replaces the progress bar with a thumbnail of your image. On the right, a pile of text boxes asks you for all kinds of information about your picture (see Figure 6-8).

  4. Scroll down and fill in the information for your picture. WordPress asks for the following:

  5. Optionally, you can edit your picture by clicking the Edit Image link, which appears just above all the text boxes. Click Save when you finish.

    When you edit a picture, WordPress opens the Edit Image box (Figure 6-10). There, you can make a few simple changes.

    Most usefully, you can crop your picture. To do that, drag a rectangle around the region you want to keep and then click the Crop button, which appears in the small strip of buttons above your picture. This is the most common type of picture edit.

    You can also scale your picture down, reducing its size. To do so, type in either a new width or a new height in the Scale Image section on the right, using pixels as the unit of measure. WordPress adjusts the other dimension proportionally, ensuring that you don’t distort the picture. Then click Scale to apply the change.

    Finally, you can also flip or rotate your picture by clicking the corresponding button above the picture.

  6. Click the “Insert into post” button in the Insert Media window to add the picture to your post.

    When you insert a picture, you’ll see it in the visual editor. If you chose left or right alignment, you can type your text around the side of the picture. If you chose None or Center for the alignment, you can type text only above and below the image.

    To tweak your picture, first click it to select it. Two small icons appear in the picture’s top-left corner. Click the “X” icon to remove the picture from your post. Click the pencil icon to open an Image Details box that lets you alter the picture (using all the same tools available when you first insert a picture).

You might choose to delete a media file as part of your basic website housekeeping. After all, why keep a file you’re not using, especially if it’s distracting you from the files you really do want?

To delete a media file, point to its filename and then click the Delete Permanently link that appears underneath.

If you delete a picture that other posts are using, you have a small problem. Now when someone reads the post, they’ll see the broken-picture-link icon, the universal browser sign that something is missing. Correcting this problem is easy (just edit the post to delete the picture box), but it’s up to you to find the post.

You might choose to add an image to your library to prepare for future posts. Maybe you have a batch of pictures that detail a home renovation project, and you plan to write about the process on your blog, “Home Sweet Home.” However, you don’t want to start writing those posts yet. To make sure the pictures are ready when you need them, you can upload them straight to the media library, and then use them later. Here’s what to do:

To insert a picture from the media library into a post, use the same Add Media button you learned about earlier. Here’s what to do as you create or edit a post:

Instead of simply including a picture in a post, you can designate it as a featured image. A featured image represents a post, but it doesn’t actually show up as part of the post content. Instead, its role varies depending on the theme you use.

Some themes ignore featured images altogether. But many others place featured images at the top of the corresponding post, near the title area. Examples include Twenty Twelve, Twenty Thirteen, and Twenty Fourteen (as shown in Figure 6-13).

Some themes exploit featured images in clever ways. For example, the Twenty Eleven theme temporarily swaps in the picture for the name of your site when you view a post with a featured image (Figure 6-14).

More ambitious themes use featured images to promote posts—for example, to highlight them in some sort of scrolling banner or gallery. Depending on the theme, this detail might be a built-in part of the home page, or it might rely on a theme-specific widget.

Figure 6-15 shows the free Brightpage theme, which is available to self-hosted WordPress sites. It displays a featured-image slideshow on the home page. This slideshow automatically grabs all the posts in the category named Featured (which you must create) and displays the featured images for each post, one after the other.

The nice thing about Brightpage is that it makes it easy for you, the site designer, to choose what posts get featured treatment. When you create a new post that you want to appear in the slider, assign it to the Featured category (in addition to whatever more meaningful category you already use). After some time passes and you decide that the post is no longer important, go to the Edit Post page and remove it from the Featured category.

The Twenty Fourteen theme has a similar trick in store. Like Brightpage, it examines a group of posts you pick, retrieves their featured images, and uses them on the home page. The difference is in the details. While Brightpage asks you to identify the posts you want to use by creating a category named Featured, Twenty Fourteen expects you to use a tag named Featured. And while Brightpage uses a slider, Twenty Fourteen gives you the choice of a slider or a slick grid view, the latter being the standard setting (Figure 6-16).

Each post can have just one featured image. To assign a featured image, you need to be in the Add New Post or Edit Post page. Then follow these steps:

  1. Click the Add Media button.

    This opens the Insert Media window you saw earlier (Figure 6-7).

  2. Click the Set Featured Image link on the left.

  3. If the picture you want to use isn’t already in the media library, upload it now.

    You can upload your featured image by dragging it onto the Insert Media window, or by clicking Select Files and browsing for it.

    If your picture is already in the Media Library, click the Media Library tab and then click the picture to select it.

  4. Add the image information.

    These details include the title, alternate text for screen readers, the caption, and the description. How much of this information WordPress uses in your post depends on the theme you chose, but it’s worth supplying the info just in case.

  5. Click Edit Image, take a moment to scale and crop your picture, and then click Save to make your changes permanent.

    When you insert a standard image into a post, you get the chance to size it. But when you use a featured image, you don’t have this control. If you upload a big picture, it’s possible that your theme will automatically crop out a large part of it. (The Brightpage theme does this, for example.) To prevent this, you need to scale the picture down before you upload it, using an image editor like Photoshop Elements, Windows Photo Gallery, Picasa, or the Mac’s Preview program. To find the right dimensions, you need to experiment or scour your theme’s documentation. (Self-hosters, search for your theme at http://wordpress.org/themes, and then click your way through to the “Theme Homepage” link. WordPress.com users, search for your theme at http://theme.wordpress.com.)

  6. Click the “Set featured image” button in the bottom-right corner.

    This adds the featured image and closes the Insert Media window so you can continue writing your post. Remember, you won’t see the picture appear alongside your text.

    If you decide at some point that you don’t want this picture as your post’s featured image, find the Featured Image box in the bottom-right corner of the page (it shows a scaled-down preview of your pic) and then click “Remove featured image.”

  7. Publish your post (or update it, if you already published it).

    Remember, some themes don’t use featured images at all. If you use such a theme, you may not even know that your post has a featured image, because your theme never displays it.

Showing Part of a Post

At the heart of every WordPress blog is a home page, and at the heart of every home page is a reverse-chronological list of posts. This list serves a vital purpose, showing a snapshot of current content so readers can tell, at a glance, what’s going down on your site.

However, the home pages you’ve seen so far have had one potential problem—they’re long, sometimes awkwardly so. Having multiple posts fused together into one long page is a great convenience for new visitors who want to read your content from end to end, but it’s not so helpful for return visitors who want to survey your new content and decide where to dive in.

Fortunately, WordPress has a handy solution. You can decide to show only the first part of each post, called a teaser, on your home page, which your visitor can click to read the standalone post.

One advantage to this approach is that you can pack quite a few teasers into your home page and keep them close together, no matter how long the posts really are. You can also put posts into tighter layouts—for example, creating a site that looks more like the front page of a newspaper. Another advantage is that it encourages readers to click through to the post, where they’ll also see the post comments and get the opportunity to join in the discussion.

However, trimming down posts introduces two possible disadvantages. First, there’s the extra link readers need to follow to read a full post. If someone wants to read several posts in a row, this extra step can add up to a lot more clicking. Second, you need to explicitly tell WordPress what part of a post belongs on the home page. It’s an easy job, but you need to do it for each post you create. If you’ve already written a few posts, you need to update them.

In the following section, you’ll learn how to use teasers instead of full posts. You’ll also consider two related features: breaking posts into multiple pages and using post excerpts.

The best way to cut a post down to size is with a special WordPress code called the More quicktag. You place the More quicktag at the spot where you want to divide a post. The content that falls before the tag becomes the teaser, which WordPress displays on the home page (Figure 6-17, left). If a reader clicks through to the post page, he sees the entire post (Figure 6-17, right).

To insert the More quicktag in the visual editor, go to the spot in your post where you want to put the tag, and then click the Insert Read More Tag button. You’ll see a light-gray dividing line (Figure 6-18).

You can also add the More quicktag in the HTML editor. You could click the button labeled “more,” but it’s just as easy to type in the tag yourself, wherever you want it:

<!--more-->

HTML nerds will recognize that the More quicktag looks exactly like an HTML comment—the sort of thing you might put in your markup to leave notes to yourself. Browsers ignore HTML comments, and WordPress borrows this system to sneak in some of its own special codes.

There’s one more trick you can do with the More tag. In the previous example, a “Continue reading” link led from the teaser to the full post. The theme determines the link’s wording, but you can substitute your own text. To do that, you need to edit your post in HTML view, and then stick the link text in the middle of the More tag, exactly as shown here:

<!--more Tell me more-->

If you want to change the link text for every teaser, editing your theme is far more efficient than editing individual posts (see Part 4 to learn how to edit your theme).

There’s another way to shorten posts on the home page: by using WordPress’s excerpts feature. Ordinarily, an excerpt is the first 50 or so words in a post (the exact number depends on the theme).

Before you can really understand excerpts, you need to know how WordPress uses them. The answer isn’t straightforward, because it depends on your theme. Some older themes may avoid excerpts altogether, while others use them prominently (as you’ll see shortly). But most themes use excerpts in at least one place: on the search results page. To take a look for yourself, type something into the search box and then press Enter (Figure 6-20).

So far, excerpts seem straightforward and automatic (and they are). However, the first few sentences of a post aren’t always a good reflection of its content. For that reason, you may want to write your own excerpt—in other words, explicitly provide a brief summary of the content in a post. You can do that from the Add New Post or Edit Post pages. First, choose Screen Options in the upper-right corner, and then turn on the checkbox next to Excerpt. A new box appears where you can write a custom description of your post.

At this point, you might think that it’s not worth the trouble to write excerpts for all your posts. And you could be right, if you use a standard theme and you don’t think that your visitors are going to be searching for posts. However, there’s another factor to consider: Some themes use excerpts for other purposes.

For example, many themes use excerpts as the display text for posts on the home page. This way, the excerpt acts a bit like a teaser. The difference is that the standard WordPress teaser comes from the first part of a post, but you control the wording in an excerpt.

The Brightpage theme described earlier (Featured Images) uses this system. If you provide an excerpt for a post, that’s what shows up on your home page, not the post content. The Oxygen theme, available for both WordPress.com and self-hosted sites, does the same thing, as you can see in Figure 6-21.

If you switch to a theme that makes heavy use of excerpts, you might find the summary so valuable that you want all your posts to use them, even the ones you’ve already created. WordPress has some plug-ins that can help. For example, the Excerpt Editor (http://tinyurl.com/csudedx) can give you a summary for every existing post, without you having to edit each one individually.

Post Formats

As you learned in Chapter 5, your choice of theme determines the basic appearance of every post on your site. Once you pick a theme, you can relax knowing that all your posts get the same font, color scheme, and spacing. Consistency reigns.

But some themes offer an underused feature called post formats, which display different types of posts in different ways. On paper, post formats sound pretty nifty. The idea is that you pick a format for each type of post you write, and your theme uses slightly different styling for each of those post types.

The problem is that WordPress limits themes to a small set of officially sanctioned formats. They’re mainly useful if you want to create a casual blog (sometimes called a microblog), where you throw together pictures, video clips, and post fragments, without worrying too much about organizing your content. In this scenario, post formats provide a structure that can help tame the chaos of your posts. But if you want to create your own post format to distinguish a group of posts that are particularly important to your site, you’re out of luck.

If your theme supports post formats, you’ll see a Format box in the Add New Post and Edit Post pages. There, you’ll find a list of all the formats you can use with the theme. You can pick any of them for a post, but if you don’t make a choice, your post sticks with Standard.

Table 6-1 lists all the post formats that WordPress allows. Themes can pick and choose which of them they allow.

You see these formats at work in the year themes (How Themes Work), from Twenty Eleven on. Each theme has its own way of styling the formats. Often, you’ll be hard-pressed to spot the minor changes between an ordinary post and one with a format applied. In many cases, the only difference you’ll notice is the lack of a title for many formats (like asides and status updates) and the addition of a small icon. The Twenty Thirteen theme applies the most dramatic post format styles, with background colors (Figure 6-22).

To get a better sense of what your theme’s post formats look like, create some test posts and look at them on the home page.

Some themes include a specialized widget to work with post formats. The most common example is the ephemera widget. Twenty Eleven and Twenty Fourteen both include one, named Twenty Eleven Ephemera and Twenty Fourteen Ephemera. The other year themes don’t include the ephemera widget at all.

As the name suggests, the ephemera widget is all about fleeting scraps of content that are useful for a short period of time, like asides, quotes, and status updates. The ephemera widget gathers these bits of microblog content and displays them in a small, self-contained strip that you can pop into a sidebar (Figure 6-23). The idea is to call attention to smaller scraps of information that might otherwise be swallowed up in the clutter of your blog.

To use the ephemera widget, choose Appearance→Widgets to visit the widget-designing section of the dashboard. Then, drag the widget to the spot on the page where you want it. Finally, customize it by supplying these three details:

All in all, the ephemera widget offers an interesting way to extract bits of content from a loosely structured blog. However, most serious bloggers are better served by using Twitter for microblogging and integrating a Twitter feed into their sidebars, as described on Sharing Your Tweets on Your Site.