Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter udimagnet

    (@udimagnet)

    Hey,
    well, i’m not a php programmer – ive taken parts of codes from all over the web.. usually it works but this time… ??

    Here is my current code, after your changes. any chance there will be a miracle here?

    <?php $result = $wpdb->get_results("SELECT comment_count, ID, post_title, post_excerpt FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 3");
    							foreach ($result as $post) {
    							setup_postdata($post);
    							$postid = $post->ID;
    							$title = $post->post_title;
    							$commentcount = $post->comment_count;
    							$excerpt = $post->post_excerpt;
    							if ($commentcount != 0) { ?>
    
    					<div class="mostCommentedBox">
    							<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php
    						if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
    						  the_post_thumbnail();
    						} else { ?>
    
    						<img src="<?php bloginfo('template_directory'); ?>/images/noimage.jpg">
    
    						<?php } ?> </a>
    						<strong><a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>"><?php echo $title ?></a></strong>
    						<div class="mostCommentedBoxCommetsCount" title="<?php echo $commentcount ?> comments"><?php echo $commentcount ?></div>
    							<p><?php echo $excerpt; ?></p>
    
    					</div>
    
    					<?php } } ?>

    Thanks so much

    Thread Starter udimagnet

    (@udimagnet)

    Thanks for the reply but…Nope, still doesnt work… ??

Viewing 2 replies - 1 through 2 (of 2 total)