Results 1 to 4 of 4

Thread: Exclude pages not working

  1. #1
    Thread Starter
    adtractiebv's Avatar
    Join Date
    Jul 2014
    Location
    Netherlands
    Posts
    236
    Thanks
    8
    Thanked 17 Times in 16 Posts

    Exclude pages not working

    Hello all,

    at www.dealpoint.nl I tried to add the following code to functions.php:

    function remove_pages_from_search($query) {
    if ($query->is_search) {
    $query->set('post_type', 'post');
    }
    return $query;
    }
    add_filter('pre_get_posts','remove_pages_from_sear ch');

    Alsosome other codes I tried to excluse pages from search results did not do the job.

    Would anyone have a code that works?

  2. #2
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,967
    Thanks
    169
    Thanked 3,406 Times in 3,277 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  3. #3
    Thread Starter
    adtractiebv's Avatar
    Join Date
    Jul 2014
    Location
    Netherlands
    Posts
    236
    Thanks
    8
    Thanked 17 Times in 16 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,967
    Thanks
    169
    Thanked 3,406 Times in 3,277 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Under Search Settings - What Does Exclude Pages Mean?
    By edealsetc in forum Help Using Clipper
    Replies: 3
    Last Post: January 28th, 2014, 07:08 PM
  2. [SOLVED] [Search Settings]: Exclude Pages not working
    By oggypopov in forum Report ClassiPress Bugs
    Replies: 3
    Last Post: September 30th, 2013, 05:42 AM