• I’m using Search & Filter in the sidebar of a custom taxonomy archive template called taxonomy-resourcetype.php. Search & filter is called via theshort code below in the enhanced text widget populating the sidebar.

    [searchandfilter fields=”resourcetype,primarytopic,audience,post_date” hierarchical=”1,1,1,,” types=”,,,daterange” headings=”,,,Date Range” submit_label=”Filter” post_types=”resources”]. That populates the sidebar with 3 taxonomy selects and a date range.

    The URL of the menu item that loads this template is https://domainhere.com/resourcetype/press-releases/?post_date=2016-01-01+2016-12-31. I have 4 test posts in the database for this custom post type (resource) and taxonomy (resourcetype). The resourcetype term that this template focuses on is “press-releases”. 3 of the 4 test posts have a date within the 2016 range. The forth one has a date in the year 2014.

    This page also uses a plugin called ubermenu which allows creating a “dynamic post” menu item for populating a menu with custom post types. One of menu custom post types is “board members”, that uses this dynamic posts functionality. All of these board members have a publish date in the year 2016.

    On first load, the page displays the 3 press releases that are in the initial date range. The ubermenu also is populated properly with all of the board members. However, when I change the S&F date range to 01/01/2015 to 12/31/2015, no press releases are shown as would be expected, but also hovering over the ubermenu shows the board members menu item with the error “[Dynamic Posts] (2952): No results found” and no board members are shown. Then when I change one of the board members publish dates to be in the 2015 date range, that one board member shows up. In addition, for some reason this error has caused the get_header_image() to return false, leading to no header image which is not the case. I’m not sure how that fits into all of this, but it only happens when the menu error occurs. I believe it has some thing to do with using the content-none.php template rather than content.php, but can’t yet see how that affects get_header_image().

    So it seems pretty clear that the S&F plugin post_types=”resources” parameter is not being used properly, such that the post_date range is being applied to all loops.

    Has this been reported by others? Is there anything in the works to fix it? Or is it user error on my part in some way?

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter mhair

    (@mhair)

    An update, I’ve found the evidence to what I was mentioning. Both report ‘no_found_rows’ => true.

    I also noted ‘suppress_filters’ => false

    but looking at the codes, normally defaults to true.

    Is that what is allowing this filter to “leak” to other post types?

    
    $wp_query->query_vars via pre_get_posts = array (
      'numberposts' => 5,
      'category' => 0,
      'orderby' => 'title',
      'order' => 'ASC',
      'include' => 
      array (
      ),
      'exclude' => '',
      'meta_key' => '',
      'meta_value' => '',
      'post_type' => 
      array (
        0 => 'boardmembers',
      ),
      'suppress_filters' => false,
      'offset' => 0,
      'no_found_rows' => true,
      'posts_per_page' => '-1',
      'tag_id' => '',
      'post_status' => 'publish',
      'ignore_sticky_posts' => true,
      'error' => '',
      'm' => '',
      'p' => 0,
      'post_parent' => '',
      'subpost' => '',
      'subpost_id' => '',
      'attachment' => '',
      'attachment_id' => 0,
      'name' => '',
      'static' => '',
      'pagename' => '',
      'page_id' => 0,
      'second' => '',
      'minute' => '',
      'hour' => '',
      'day' => 0,
      'monthnum' => 0,
      'year' => 0,
      'w' => 0,
      'category_name' => '',
      'tag' => '',
      'cat' => '',
      'author' => '',
      'author_name' => '',
      'feed' => '',
      'tb' => '',
      'paged' => 0,
      'preview' => '',
      's' => '',
      'sentence' => '',
      'title' => '',
      'fields' => '',
      'menu_order' => '',
      'embed' => '',
      'category__in' => 
      array (
      ),
      'category__not_in' => 
      array (
      ),
      'category__and' => 
      array (
      ),
      'post__in' => 
      array (
      ),
      'post__not_in' => 
      array (
      ),
      'post_name__in' => 
      array (
      ),
      'tag__in' => 
      array (
      ),
      'tag__not_in' => 
      array (
      ),
      'tag__and' => 
      array (
      ),
      'tag_slug__in' => 
      array (
      ),
      'tag_slug__and' => 
      array (
      ),
      'post_parent__in' => 
      array (
      ),
      'post_parent__not_in' => 
      array (
      ),
      'author__in' => 
      array (
      ),
      'author__not_in' => 
      array (
      ),
    )
    
    $wp_query->query_vars via pre_get_posts = array (
      'numberposts' => 5,
      'category' => 0,
      'orderby' => 'none',
      'order' => 'DESC',
      'include' => 
      array (
      ),
      'exclude' => 
      array (
      ),
      'meta_key' => '_wp_attachment_is_custom_header',
      'meta_value' => 'FoundationPress',
      'post_type' => 'attachment',
      'suppress_filters' => false,
      'nopaging' => true,
      'post_status' => 'inherit',
      'posts_per_page' => 5,
      'ignore_sticky_posts' => true,
      'no_found_rows' => true,
      'error' => '',
      'm' => '',
      'p' => 0,
      'post_parent' => '',
      'subpost' => '',
      'subpost_id' => '',
      'attachment' => '',
      'attachment_id' => 0,
      'name' => '',
      'static' => '',
      'pagename' => '',
      'page_id' => 0,
      'second' => '',
      'minute' => '',
      'hour' => '',
      'day' => 0,
      'monthnum' => 0,
      'year' => 0,
      'w' => 0,
      'category_name' => '',
      'tag' => '',
      'cat' => '',
      'tag_id' => '',
      'author' => '',
      'author_name' => '',
      'feed' => '',
      'tb' => '',
      'paged' => 0,
      'preview' => '',
      's' => '',
      'sentence' => '',
      'title' => '',
      'fields' => '',
      'menu_order' => '',
      'embed' => '',
      'category__in' => 
      array (
      ),
      'category__not_in' => 
      array (
      ),
      'category__and' => 
      array (
      ),
      'post__in' => 
      array (
      ),
      'post__not_in' => 
      array (
      ),
      'post_name__in' => 
      array (
      ),
      'tag__in' => 
      array (
      ),
      'tag__not_in' => 
      array (
      ),
      'tag__and' => 
      array (
      ),
      'tag_slug__in' => 
      array (
      ),
      'tag_slug__and' => 
      array (
      ),
      'post_parent__in' => 
      array (
      ),
      'post_parent__not_in' => 
      array (
      ),
      'author__in' => 
      array (
      ),
      'author__not_in' => 
      array (
      ),
    )
    
    
Viewing 1 replies (of 1 total)
  • The topic ‘Not respecting post_types. post_date affecting other loop’ is closed to new replies.