spirit posteets tagged exclude  [ Profile ]

Sort by: Date / Title /

  1. 6 years ago
    Add it to functions.php of your theme
    1. <?php
    2.  
    3. add_filter( 'pre_get_posts', 'cat_search_filter' );
    4. /**
    5. * Exclude category 7 from search results.
    6. *
    7. * @param WP_Query $query Existing query object
    8. * @return WP_Query Amended query object
    9. */
    10. function cat_search_filter( $query ) {
    11.  
    12. if ( $query->is_search && !is_admin() )
    13. $query->set( 'cat','-7' );
    14.  
    15. return $query;
    16.  
    17. }
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2154"></script>
  2. 10 years ago
    1. find . -name .svn -prune -o -print | xargs chown www-data:www-data
    2.  
    3. #Exclude another directory (cache)
    4. find . -name .svn -or -name cache -prune -o -print | xargs chown www-data:www-data
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1417"></script>

First / Previous / Next / Last / Page 1 of 1 (2 posteets)