register_widget('Apollo13_Widget_Popular_Posts');and
class Apollo13_Widget_Related_Posts extends WP_Widget {Oh, and if you want to show only random posts of a certain category change
$r = new WP_Query(array($search_string => $__search,'post__not_in' => array($post->ID), 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true));to
$r = new WP_Query(array($search_string => $__search,'post__not_in' => array($post->ID), 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'category_name' => 'PUT_YOUR_CATEGORY_NAME_HERE'));in the attached snippet.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
There are not many such nice users as you :-) Thanks!
With regards.