Unable to assign page to Header

Hey!

Just noticed I’m unable to assign a page to a Header. I can only see posts in the assign section on the right and no pages.

I’ll include a note to the staging site.

Edit: I’m also unable to select pages here: http://jmp.sh/RTbteBp (so now I’m unable to edit with pro too).

Hi There,

Please find this code:

function remove_pages_from_search() {
    global $wp_post_types;
    $wp_post_types['page']->exclude_from_search = true;
}
add_action('init', 'remove_pages_from_search');

And change to this:

function search_filter($query) {
  if ( !is_admin() && $query->is_main_query() ) {
    if ($query->is_search) {
      $query->set('post_type', 'post');
    }
  }
}

add_action('pre_get_posts','search_filter');

Hope it helps :slight_smile:

Terrific, that worked like a charm.

You’re most welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.