function textbook_content_display($content) {
global $post;
//check for the custom post type
if (get_post_type() != "textbook") {
return $content;
}
else {
$custom = get_post_custom($post->ID);
$newContent='
'. get_the_title($post->ID).
'
';
$author = $custom['textbook_author'][0]; //authors
$pubdate = $custom['textbook_date'][0]; //date
$newContent .= ' By:' . $author; $newContent .= '(' . $pubdate . ')
';
$newContent .= '' . $content . '
';
return $newContent;
}
}
add_filter('the_content','textbook_content_display');