Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Exclude images from search results - WordPress
- add_action( 'init', 'exclude_images_from_search_results' );
- function exclude_images_from_search_results() {
- global $wp_post_types;
- $wp_post_types['attachment']->exclude_from_search = true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement