dyadica.net

Fun and Games in the Dyadic Sea

Posts Tagged ‘TPT’

permalink image comments image
Sunday, 11 November '07: Paper Trail 0.4

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. Read..

Tags: , , , , ,

poll tags

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