..uncommented related posts and comics so that sites do not continue to be b0rked from the functions/displayblogpost.php and functions/displaycomicpost.php calls those functions.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
parent
12ffca740a
commit
2cc315dcdc
|
@ -6,7 +6,7 @@
|
||||||
* Usage: [related_comics]
|
* Usage: [related_comics]
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
function related_comics_shortcode( $atts = '' ) {
|
function related_comics_shortcode( $atts = '' ) {
|
||||||
extract(shortcode_atts(array(
|
extract(shortcode_atts(array(
|
||||||
'limit' => '5',
|
'limit' => '5',
|
||||||
|
@ -66,7 +66,7 @@ function related_comics_shortcode( $atts = '' ) {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
add_shortcode('related_comics', 'related_comics_shortcode');
|
// add_shortcode('related_comics', 'related_comics_shortcode');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
*/
|
|
||||||
|
|
|
@ -6,15 +6,14 @@
|
||||||
* Usage: [related_posts]
|
* Usage: [related_posts]
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
|
|
||||||
function related_posts_shortcode( $atts = '' ) {
|
function related_posts_shortcode( $atts = '' ) {
|
||||||
extract(shortcode_atts(array(
|
extract(shortcode_atts(array(
|
||||||
'limit' => '5',
|
'limit' => '5',
|
||||||
), $atts));
|
), $atts));
|
||||||
|
|
||||||
global $wpdb, $post, $table_prefix, $category_tree;
|
global $wpdb, $post, $table_prefix, $category_tree;
|
||||||
|
|
||||||
if ($post->ID) {
|
if ($post->ID) {
|
||||||
// Get tags
|
// Get tags
|
||||||
$tags = wp_get_post_tags($post->ID);
|
$tags = wp_get_post_tags($post->ID);
|
||||||
|
@ -33,9 +32,9 @@ function related_posts_shortcode( $atts = '' ) {
|
||||||
GROUP BY tr.object_id
|
GROUP BY tr.object_id
|
||||||
ORDER BY count DESC, p.post_date_gmt DESC
|
ORDER BY count DESC, p.post_date_gmt DESC
|
||||||
LIMIT $limit;";
|
LIMIT $limit;";
|
||||||
|
|
||||||
$related = $wpdb->get_results($q);
|
$related = $wpdb->get_results($q);
|
||||||
|
|
||||||
if ( $related ) {
|
if ( $related ) {
|
||||||
$retval = '
|
$retval = '
|
||||||
<div class="related_posts">
|
<div class="related_posts">
|
||||||
|
@ -54,23 +53,22 @@ function related_posts_shortcode( $atts = '' ) {
|
||||||
if (count(array_intersect($comic_categories, wp_get_post_categories($r->ID))) == 0)
|
if (count(array_intersect($comic_categories, wp_get_post_categories($r->ID))) == 0)
|
||||||
$retval .= '
|
$retval .= '
|
||||||
<tr><td class="archive-date" align="right">'.date('M j, Y',strtotime($r->post_date)).'</td><td class="archive-title"><a title="'.wptexturize($r->post_title).'" href="'.get_permalink($r->ID).'">'.wptexturize($r->post_title).'</a></td></tr>';
|
<tr><td class="archive-date" align="right">'.date('M j, Y',strtotime($r->post_date)).'</td><td class="archive-title"><a title="'.wptexturize($r->post_title).'" href="'.get_permalink($r->ID).'">'.wptexturize($r->post_title).'</a></td></tr>';
|
||||||
endforeach;
|
endforeach;
|
||||||
$retval .= '
|
$retval .= '
|
||||||
</table>';
|
</table>';
|
||||||
} else {
|
} else {
|
||||||
$retval .= '
|
$retval .= '
|
||||||
<li>'.__('No related posts found','comicpress').'</li>';
|
<li>'.__('No related posts found','comicpress').'</li>';
|
||||||
}
|
}
|
||||||
$retval .= '
|
$retval .= '
|
||||||
</li></ul>';
|
</li></ul>';
|
||||||
$retval .= '
|
$retval .= '
|
||||||
</div>';
|
</div>';
|
||||||
return $retval;
|
return $retval;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_shortcode('related_posts', 'related_posts_shortcode');
|
// add_shortcode('related_posts', 'related_posts_shortcode');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
*/
|
|
Loading…
Reference in New Issue