Skip to content

Instantly share code, notes, and snippets.

@michaelbourne
Created April 25, 2018 21:37
Show Gist options
  • Save michaelbourne/ee66df4f2265f2a02706cefe3c5d015d to your computer and use it in GitHub Desktop.
Save michaelbourne/ee66df4f2265f2a02706cefe3c5d015d to your computer and use it in GitHub Desktop.
Override the Pro Theme header assignment for specific pages and conditions
add_filter('cs_match_header_assignment', 'custom_search_header');
function custom_search_header($match) {
$user = wp_get_current_user();
if (is_search()) {
$match = 1234; // the post ID for your header
}
elseif (is_404()) {
$match = 4567; // the post ID for your header
}
return $match;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment