dyadica.net

Fun and Games in the Dyadic Sea

Paper Trail 0.4

permalink image comments image
Sunday, 11 November '07 :

I have added a little extra functionality to the old Paper Trail script to allow for a pages parents child pages to be shown if required as in earlier versions. This is very useful if you have a collection of articles under a single banner such as the TBG tutorials here at this site. The code is as follows:

<?php if (function_exists(‘pollChildren’)) {

if ( get_post_meta($post->ID, “poll-dad”, true) == “TRUE” ) {

$post = $posts[0];
$dad = $post->post_parent;
$name = str_replace(“/”.$post->post_name,”",$_SERVER['REQUEST_URI']);

$nDad = $wpdb->get_results(“SELECT ID, post_title, post_name FROM wp_posts WHERE ID=”.$dad);

echo “<div class=’post-head’>”.$nDad[0]->post_title.” chapters</div>”;

echo “<ul class=’paper-trail-child’>”;
pollChildren($dad, $wpdb, $name );
echo “</ul>”;
}

} ?>

As you can see I am utilizing the get_post_meta() command to trigger the code. This means that I can call the function as and when required on any page that I assign the key “poll-dad” simple eh. For more information and additional usages for get_post_meta() command have a look at the adding an intro to wordpress pages post.

I have purposely kept this output separate from the main Paper Trail body as on occasion I think that I might like to have this facility without having to run Paper Trail itself. You will notice from the code that I have also migrated the existing code fully to function calls.

I will divulge more details on this when and if I get chance to write things up, however it should be pretty obvious to all those savvy folks out there though (use the wordpress functions.php).

Tags: , , , , ,

page meta

get trackback image get trackback image
details
  • Posted: Sunday, 11 November '07
  • Edited: Friday, 25 July '08
  • Category: design
  • Author: admin

say what do you think

RSS feed | Trackback URI

css | xhtml | dyadica.net © admin 2010 | powered: wordpress | fuel: ps-wii-elite | top | sign-up