Categories
WordPress WordPress Plugins

New Plugin Release: WP Query Counter

WP Query Counter is designed to aid developers in using the WordPress query functions as efficiently as possible.

The plugin starts a counter when WordPress initializes and displays the number of executed queries in an absolutely positioned div in the lower right-hand corner of your screen.

You can check it out here!

Categories
Code WordPress

WordPress: Exclude Pages from Search Results

Add the following to your functions.php file to exclude pages from the search results of your WordPress blog.

//Filter out pages from search results
function search_exclude_pages($query) {
 if ($query->is_search) {
 $query->set('post_type', 'post');
 }
 return $query;
}
add_filter('pre_get_posts','search_exclude_pages');