replace related post search with unified code
This commit is contained in:
parent
a818df4f4d
commit
a7b1945866
|
@ -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');
|
||||
|
||||
|
||||
?>
|
||||
?>*/
|
||||
|
|
|
@ -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');
|
||||
|
||||
?>
|
||||
?>
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue