• Resolved akacruiseman

    (@akacruiseman)


    Nobita,
    How would I add a widget area to the header for “register/login”?
    Just spent a good deal of time attempting such but I am not so lucky.

    Thanks,
    Jim

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author nobita

    (@nobita)

    Hi @akacruiseman

    For Example

    /**
     * Create Widget Area
     */
    add_action( 'widgets_init', 'my_widgets_init' );
    
    function my_widgets_init() {
    
    	register_sidebar( array(
    		'name'			 => esc_html__( 'Login Page', 'raindrops' ),
    		'id'			 => 'sidebar-6',
    		'description'	 => '',
    		'before_widget'	 => '<li  id="%1$s" class="%2$s widget" ' . raindrops_doctype_elements( '', 'tabindex="-1"', false ) . '>',
    		'after_widget'	 => "</li>\n",
    		'before_title'	 => "\n\t<h2 class=\"widgettitle\">",
    		'after_title'	 => "</h2>\n",
    	) );
    }
    /**
     * Show Widget on login page
     */
    add_action( 'login_footer','my_login_widget');
    
    function my_login_widget(){
    	
    ?><ul style="width:320px;margin:auto;background:#fff"><?php
    	dynamic_sidebar( 'sidebar-6' );
    ?></ul><?php
    }

    Thank you.

    Thread Starter akacruiseman

    (@akacruiseman)

    Got it. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Widget in Header’ is closed to new replies.