Here’s my current codes to get popular post from wordpress wp_post table. How can I exclude those in categories such as 3 or 4?
$popularposts = "SELECT ID,post_title FROM {$wpdb->prefix}posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY comment_count DESC LIMIT 0,".$pop_posts;
$posts = $wpdb->get_results($popularposts);
Dugg through the web and stackoverflow, almost solved the problem. Still I need add
somewhere in the following code.
after ‘publish’ you add (assuming the field for categorie is categorie)
or, if categorie is numeric: