WordPress get posts by date without query_posts

Yes, simple add a filter before you call it and remove it after you do function filter_where_wpa89154($where=””) { //posts in the last 30 days $where .= ” AND post_date > ‘” . date(‘Y-m-d’, strtotime(‘-30 days’)) . “‘”; return $where; } add_filter(‘posts_where’, ‘filter_where_wpa89154’); $args = array( ‘posts_per_page’ => 5, ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘suppress_filters’ … Read more

How to remove bulk edit options

A more reliable approach than messing with CSS would be to add some Javascript in the admin_head action, and basically override the built-in “inlineEditPost” function (located in wp-admin/js/inline-edit-post.js and easier to read in inline-edit-post.dev.js). I haven’t looked into it much specifically, but the brute force method would be to copy (and rename) that entire function … Read more

Hide comments awaiting moderation from user who submitted the comments

Check in your theme’s comments.php for the wp_list_comments() function. In the Twenty Eleven theme, for example, uses a custom callback function which is in the functions.php file and outputs the template for comments. Within this comments template, you can then use wp_get_comment_status() and only display a comment if it was approved. Example from the Codex: … Read more