Support

Account

Home Forums Front-end Issues Top menu disapears in Category Pages when filtering using ACF Reply To: Top menu disapears in Category Pages when filtering using ACF

  • Hi @uakz

    Your pre_get_posts filter has the potential to affect every WP_Query on the page! This would explain why your top menu is not returning the correct data.

    Looking at the WP docs: http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts it seems that another validation is done in the filter to make sure this is the main query on the page:

    if ( !is_admin() && $query->is_main_query() ) {

    So you could add another line to the top of your filter like this:

    // validate if( !$query->is_main_query() ) { return; }

    hope that helps