WordPress.org

Support

Support » Plugins and Hacks » Page never stops loading (widget problem)

Page never stops loading (widget problem)

  • Hello, here is the code for the widget that makes the page never stop loading. I validated the page in xhtml strict but can’t seem to find the cause for the loading. If someone could help that would be great!!

    global $wpdb;
    
    		/* Before widget (defined by themes). */
    		echo $before_widget;
    
    		/* Display the widget title if one was input (before and after defined by themes). */
    		if ( $title )
    			echo $before_title . $title . $after_title;
    
    				echo '<div class="poppostcom">';
    				echo '<ul>';
    
    				$result = $wpdb->get_results("SELECT comment_count,id,post_title FROM " . $wpdb->posts . " ORDER BY comment_count DESC LIMIT 0 , 5");
    				foreach ($result as $post) {
    				setup_postdata($post);
    				$postid = $post->id;
    				$title2 = $post->post_title;
    				$commentcount = $post->comment_count;
    				$titlelim = substr($title2,0,25);
    				if ($commentcount != 0) { 
    
    				echo '<li>';
    
    				$image = get_post_meta($post->id, 'bigphoto', true); /* Replace lead_image with the name of the custom field for the image you want to use */
    				echo '<div class="popimgs">';
    
    				echo '<img alt="" src="http://hockleys.org/wp-content/themes/norwegiangrunge/timthumb/timthumb.php?src='.$image.'&h=30&w=30&zc=1" />';
    				echo '</div>';
    				echo '<p><a href="'.get_permalink($postid).'" title="'.$title2.'">';
    				if (strlen($title2) > 25 ) { echo ''.$titlelim.' &hellip;';
    				 } else { echo ''.$title2.''; }
    
    				echo '</a>'; echo" {";
    				echo ''.$commentcount.''; echo"}"; echo '</p>';						
    
    				echo '</li>';
    
    				 } } ;
    
    				echo '</ul>';
    				echo '</div>';
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Page never stops loading (widget problem)’ is closed to new replies.
Skip to toolbar