Hi all,
I'm trying to install wordpress here:
http://www.illshutupnow.comIt's all working except a few extra charchters being added to one of the mods at the bottom: most discussed (the green posit).
It seems to be adding a -1 and >> between each link, and i'm at a loss as to why.
The code for the most commented mod is as follows:
<?php
function get_mostcommented($limit = 10) {
global $wpdb, $post;
$mostcommenteds = $wpdb->get_results("SELECT $wpdb->posts.ID, post_title, post_name, post_date, COUNT($wpdb->comments.comment_post_ID) AS 'comment_total' FROM $wpdb->posts LEFT JOIN $wpdb->comments ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID WHERE comment_approved = '1' AND post_date_gmt < '".gmdate("Y-m-d H:i:s")."' AND post_status = 'publish' AND post_password = '' GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_total DESC LIMIT $limit");
foreach ($mostcommenteds as $post) {
$post_title = htmlspecialchars(stripslashes($post->post_title));
$comment_total = (int) $post->comment_total;
echo "<li>» <a href=\"".get_permalink()."\">$post_title</a> - $comment_total </li>";
}
}
?>
- <?php
-
- function get_mostcommented($limit = 10) {
- global $wpdb, $post;
- $mostcommenteds = $wpdb->get_results("SELECT $wpdb->posts.ID, post_title, post_name, post_date, COUNT($wpdb->comments.comment_post_ID) AS 'comment_total' FROM $wpdb->posts LEFT JOIN $wpdb->comments ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID WHERE comment_approved = '1' AND post_date_gmt < '".gmdate("Y-m-d H:i:s")."' AND post_status = 'publish' AND post_password = '' GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_total DESC LIMIT $limit");
- foreach ($mostcommenteds as $post) {
- $post_title = htmlspecialchars(stripslashes($post->post_title));
- $comment_total = (int) $post->comment_total;
- echo "<li>» <a href=\"".get_permalink()."\">$post_title</a> - $comment_total </li>";
- }
- }
- ?>
Anyone have any ideas?
Thanks
Holly x