WordPress.org

Ready to get started?Download WordPress

Forums

Vantage
How to add widgets to header area? (4 posts)

  1. oreocrumble
    Member
    Posted 9 months ago #

    I would like to add the login widget for WP members below the Site's Tagline (on right). However theme doesn't appear to support header widget. Please advise.

    My website is:
    easternconsultinggroup.com

  2. Jose
    Member
    Posted 9 months ago #

    You'll need to first register a new widget in functions.php, preferably in a child theme. If you don't have a functions.php, simply start one with a note editor, add:

    <?php
    register_sidebar( array(
    		'name' => __( 'Before Slider', 'vantage' ),
    		'id' => 'Before-Slider',
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h1 class="widget-title">',
    		'after_title' => '</h1>',
    	) );

    Where you change the 'Before Slider' and 'Before-Slider' to the name you want to assign this widget, preferably something that will help you remember its location.

    Then you'll need to place the widget where you want, in your case header.php

    <?php dynamic_sidebar( 'Before-Slider');?>

    Again, do this in a child theme in case you mess up.

    After you do this, your widget will appear in the header, but then you have to style it and give it a class, which is more complicated to do and I am still learning about it myself.

    These directions may be misguided and I am not a staff of vantage or siteorigin Use at your own risk.

    Thanks..

    Jose

  3. Jose
    Member
    Posted 9 months ago #

    accidental repost.

  4. oreocrumble
    Member
    Posted 9 months ago #

    hmm..
    wasn't succesful, updating the file returned this error

    Parse error: syntax error, unexpected '<' in D:\******\wp-content\themes\vantage\functions.php on line 342

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.