replace related post search with unified code

This commit is contained in:
John Bintz 2009-12-19 21:26:03 -05:00
parent a818df4f4d
commit a7b1945866
2 changed files with 15 additions and 13 deletions

View File

@ -2,18 +2,18 @@
/**
* Related comics
* Displays a list of comic links that are related to this current one using shortcode.
*
*
* Usage: [related_comics]
*
*
*/
/*
function related_comics_shortcode( $atts = '' ) {
extract(shortcode_atts(array(
'limit' => '5',
), $atts));
global $wpdb, $post, $table_prefix, $category_tree;
if ($post->ID) {
// Get tags
$tags = wp_get_post_tags($post->ID);
@ -32,7 +32,7 @@ function related_comics_shortcode( $atts = '' ) {
GROUP BY tr.object_id
ORDER BY count DESC, p.post_date_gmt DESC
LIMIT $limit;";
$related = $wpdb->get_results($q);
if ( $related ) {
$retval = '
@ -69,4 +69,4 @@ function related_comics_shortcode( $atts = '' ) {
add_shortcode('related_comics', 'related_comics_shortcode');
?>
?>*/

View File

@ -2,18 +2,19 @@
/**
* Related posts
* Displays a list of blog links that are related to this current one using shortcode.
*
*
* Usage: [related_posts]
*
*
*/
/*
function related_posts_shortcode( $atts = '' ) {
extract(shortcode_atts(array(
'limit' => '5',
), $atts));
global $wpdb, $post, $table_prefix, $category_tree;
if ($post->ID) {
// Get tags
$tags = wp_get_post_tags($post->ID);
@ -32,7 +33,7 @@ function related_posts_shortcode( $atts = '' ) {
GROUP BY tr.object_id
ORDER BY count DESC, p.post_date_gmt DESC
LIMIT $limit;";
$related = $wpdb->get_results($q);
if ( $related ) {
@ -71,4 +72,5 @@ function related_posts_shortcode( $atts = '' ) {
add_shortcode('related_posts', 'related_posts_shortcode');
?>
?>
*/