You can replace the Header Right widget using this in functions.php
Make sure you have enabled header right widget area by default. Comment out the line to enable the header right widget area
//* Remove the header right widget area //unregister_sidebar( 'header-right' );
Now, use one of the following snippets.
Front page
//* Remove Header right Widget using conditional tag. add_action( 'genesis_title', 'remove_header_right_widget', 9 ); // genesis_title, genesis_meta or wp_head function remove_header_right_widget() { if ( ! is_front_page() ) { return; } //* Remove the header right widget area unregister_sidebar( 'header-right' ); }
Post Page i.e Blog
//* Remove Header right Widget using conditional tag. add_action( 'genesis_title', 'remove_header_right_widget', 9 ); // genesis_title, genesis_meta or wp_head function remove_header_right_widget() { if ( ! is_home() ) { return; } //* Remove the header right widget area unregister_sidebar( 'header-right' ); }
for Singular Posts
//* Remove Header right Widget using conditional tag. add_action( 'genesis_title', 'remove_header_right_widget', 9 ); // genesis_title, genesis_meta or wp_head function remove_header_right_widget() { if ( ! is_singular( 'post' ) ) { return; } //* Remove the header right widget area unregister_sidebar( 'header-right' ); }
There are various WordPress Conditional tags and you can use as per your post, page or category.
is_singular( ‘post’ )
You can also use an → array ( ‘post’,’book’ ) for multiple conditions and custom post types.
is_singular( array ( 'post','book' ) )
Important Reads: