1

I am working on a Genesis Wordpress theme. What I want is to add a custom header to the theme. How do I get a header selector in the code snipper below?

    // Add support for custom header.
    add_theme_support( 'custom-header', array(
        'width'           => 600,
        'height'          => 160,
        'header-text'     => false,
        'flex-height'     => true,
    ) );
Omar
  • 180
  • 2
  • 15

2 Answers2

1

Adding the following 'header-selector' => '.site-title a', should do the job. So it would like this.

// Add support for custom header.
add_theme_support( 'custom-header', array(
    'width'           => 600,
    'height'          => 160,
    'header-selector' => '.site-title a',
    'header-text'     => false,
    'flex-height'     => true,
) );
Imsa
  • 1,105
  • 2
  • 17
  • 39
1

Add the following PHP code to your child themes functions file. Source

genesis_register_sidebar( array(
    'id'          => 'new-widget',
    'name'        => __( 'New Widget', 'domain' ),
    'description' => __( 'Add Content Here', 'domain' ),
) );

add_action( 'genesis_after_header', 'your_widget' );
function your_widget() {

if ( is_front_page() && is_active_sidebar('new-widget') ) {

genesis_widget_area( 'new-widget', array(
    'before' => '<div class="new-widget widget-area">',
    'after'  => '</div>',
        ) ); 

  }

}

This code adds a new widget after the header, To change the position of the widget, change the hook to any other genesis hooks

Dev
  • 457
  • 6
  • 18