Skip to content

Instantly share code, notes, and snippets.

@michaelbourne
Last active March 19, 2019 23:42
Show Gist options
  • Save michaelbourne/5b19eeafb64d05cd1b9951df157a1a9e to your computer and use it in GitHub Desktop.
Save michaelbourne/5b19eeafb64d05cd1b9951df157a1a9e 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 (in_array( 'author', (array) $user->roles )) {
$match = 1234; // 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