Skip to content

Instantly share code, notes, and snippets.

@joshuadavidnelson
joshuadavidnelson / remove-post-type-from-search-results.php
Last active March 8, 2022 13:56
Remove a post type from search results, but keep all others
<?php
/**
* Modify query to remove a post type from search results, but keep all others
*
* @author Joshua David Nelson, josh@joshuadnelson.com
* @license http://www.gnu.org/licenses/gpl-2.0.html GPLv2+
*/
add_action( 'pre_get_posts', 'jdn_modify_query' );
function jdn_modify_query( $query ) {
@redoPop
redoPop / .gitignore
Created June 18, 2010 22:08
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your