Wordpress
Simple Sitemap
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 has to incorporate a secondary Loop but, once you’ve figured out how to do this, it’s a trick that can come in handy elsewhere.
Attachment Templates
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
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 image icon (boolean — ‘false’ or ‘true’)
Create Attachment Viewer Links
Create links to freely available plugins/applications for attachment files based upon the attachment MIME type.
Create A Breadcrumb Trail
<?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>';
}?>
PunBB eSmiley