The simplest widget for handling page extras (and the one you will probably use most) is the Post Widget. This enables you to place any post or image in any of the editable areas of the page. Once you can do this, you’ll be well placed to start using the other widgets, which – although more complex – all use the same techniques.

A simple worked example

The page extra at the top of the side column here is simply a post.

We could have used a post from the News category here, or any other post instead – but because this one was written specifically for use as a page extra, we have categorised it as a Snippet.

This extra bit of jargon actually makes it a bit easier to find this post amongst all the others in the Dashboard listings. Do this now, and go to its Editing panel. The URL shown in the address bar of your browser will end with something like ?action=edit&post=355&message=1. The number following post= is the unique ID for this post – make a note of it, as the ID is how you tell any widget which post you want to use.

Another way of finding the ID: on the main Posts listing page, hovering over the name of the post should bring up a similar URL in the status bar of your browser.

The text of this snippet explains exactly how we placed it there – including its actual ID number.

Try it yourself

Pick an existing Post (or write your own Snippet) and add it to a side column on the Test page. If you have trouble locating the Custom Field panel, you may need to turn it on in the Screen Options area below the Admin Bar.

  1. Set the Custom Fields Name to left-0-post or right-0-post.
  2. Type ids = and the ID of your post into the Custom Fields Value field.
  3. Click Add Custom Field
  4. Update the page.

A bit more explanation

  • Each page has a number of pre-defined regions where page extras can be added. Some pages – particularly the Home page – may have additional areas defined. The name of the region always forms the first part of the Custom Field name.
  • In addition to these regions, most types of page extra can also be added to the main content area by typing an appropriate shortcode at the appropriate place in the Editing panel. This can be useful for including complex items like slideshow widgets – or simply for adding a post in a suitably styled box (see Try it yourself). More details on the Widget reference page.
  • The number in the middle of the Custom Field name is used to control the order in which items appear in that region.
  • The last part of the Custom Field name is the name of the widget.
  • Any page extras placed in a page region will be ‘inherited’ by all its sub-pages – unless they specify something else for that region.

To get the most out of any widget, you need to know what parameters it takes and what values you can give them. Full details of all the available widgets are given on the Widget reference page. Meanwhile, here’s the rest of what you need to know about the Post widget…

Post widget full specification

What it does: Lets you insert one or more posts or images, with the option of making the the whole thing into a link.

Set up with: Custom Field left-0-post, right-0-post etc, or shortcode_post.

Parameters: The values shown are examples only.

ids = 20 (REQUIRED)
style=basic (optional)
link=/about (optional)
show_title=true (optional) default = false
pic_size=thumbnail (optional) default = full

Notes: The link option really only makes sense applied to a single post. Extremely useful for creating graphic links to other pages on site.

The ids parameter is plural because you can also enter a comma-separated list of post IDs, which will then be displayed in the same order. These can be either Posts or Attachments from the Media Library (eg: photos) – WordPress thinks of all of these as different kinds of Posts.

To find the style options available on your site, examine the existing page extras.

By default the post title is suppressed – you certainly don’t want it for photos, where it’s usually the filename. If you want to show it, set show_title = true.

The pic_size parameter only applies to attachments (eg: photos). The usual available values are: thumbnail, small, medium, large and full – although this varies from site to site, and sizes greater than the original upload (full) will be unavailable.

When placing an attachment (photo), if there’s a line starting credits= in the Description field of the attachment, this will be used to drop a small camera icon in the bottom right corner of the image. This displays the credit line when moused over – and if the credit line is a link, clicking the camera will open it (eg: a Flickr page) in a new window. This facility means that it may be preferable to include most photos using the Post widget rather than placing them directly into the editing panel. Most free photos still require attribution of some sort, and this is probably the easiest way of satisfying the requirements.

Shorthand option: As well as being able to omit the order number and use left-post, right-post etc (which will be interpreted as left-0-post, right-0-post), this widget also allows the omission of ids= when there are no other parameters involved. So custom field values of 36 or 786,52,905 will be treated as IDs. These shorthands do not apply to the shortcode version.

Required:

I’m a sample Snippet

I’m nothing but a Post that’s been written for use as a page extra. My ID is 615.

To place me at the top of the right-hand column, all you need to do is add this Custom Field to the page:

Name: right-0-post

Value: ids = 615