Currently browsing 'tips'

Simple Sitemap

Posted on Thursday, December 4th, 2008 at 1:49 pm in Tips & Tricks.

On sites where Wordpress is being used as a simple Content Management System, it may be appropriate to create a site map page.
One way of achieving this — without resorting to a plugin — is to create a sitemap template within the site’s theme. It is a little trickier than usual because the template [...]

Attachment Templates

Posted on Thursday, December 4th, 2008 at 1:30 pm in Tips & Tricks.

If you want different layouts for different attachment file pages, you can include specific attachment templates within a theme based on the first part of the attachment MIME type.

Create Accessible Attachment Links

Posted on Thursday, December 4th, 2008 at 1:20 pm in Tips & Tricks.

You can use the Wordpress wp_get_attachment_link and get_attached_file functions in a number of ways to generate accessible download links — including outputting the file size and type.
The wp_get_attachment_link function has 4 parameters:

the post ID
the associated image size (’thumbnail’ or ‘medium’)
option to display the attachment’s permalink (boolean — ‘false’ or ‘true’)
option to display an associated [...]

Create Attachment Viewer Links

Posted on Thursday, December 4th, 2008 at 12:50 pm in Tips & Tricks.

Create links to freely available plugins/applications for attachment files based upon the attachment MIME type.

Create A Breadcrumb Trail

Posted on Thursday, December 4th, 2008 at 12:44 pm in Tips & Tricks.

<?php // Create a breadcrumb trail
$curr_id = get_post($post->ID);
$parent_id = $curr_id->post_parent;
if ($parent_id != 0) {
$parent = get_post($parent_id);
echo ‘<ul class=”breadcrumb”><li><a href=”‘.get_bloginfo(’url’).’”>Home</a> »</li>’;
echo ‘<li><a href=”‘.$parent->guid.’”>’.$parent->post_title.’</a> »</li>’;
echo ‘<li>’.$curr_id->post_title.’</li></ul>’;
}?>

Top