Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #770202

    Hi Guys;

    Thanks for the enfold theme and your fantastic support so far !!!

    Is it possible for me to add another custom widget are to the header of my site? I am currently using a custom widget area using the function described here to display my search provided by a secondary plugin which works very well. I have the search custm widget centred in my header using css, I would like to add another custom widget area to the right to display some custom font awesome icon links and possibly shorcodes for login / logout etc. I have the enfold basket attached to the header and would like to display these links next to it.

    View post on imgur.com

    so I have this in my child themes functions.php . . .

    add_action( 'ava_main_header', 'enfold_customization_header_widget_area' );
    function enfold_customization_header_widget_area() {
    	dynamic_sidebar( 'header' );
    }

    and css

    #header .widget {
      left: 50%;
      padding-top: 0;
      position: absolute;
      top: 0;
      transform: translate(-50%);
      z-index: 999;
    }

    Can I add a similar function and position the content to the right of my header (next to my cart) with some custom shorcode or links.

    Regards

    Pete

    • This topic was modified 7 years, 7 months ago by gtekit.
    #770244

    Hey Pete,

    Please, may you share your WP credentials and the website link?

    Best regards,
    John Torvik

    #770279

    Hey John,

    I have supplied the WP credentials, as required, Thanks for the quick response, hope you can help me out :)

    Regards

    Pete

    #770588

    Hi,

    You should be able to add as many widgets as you want with the code you posted:

    add_action( 'ava_main_header', 'enfold_customization_header_widget_area' );
    function enfold_customization_header_widget_area() {
    	dynamic_sidebar( 'header1' );
            dynamic_sidebar( 'header2' );
    }

    Just make sure to name them properly under Appearance->Widgets. You will need to change the CSS as well. For the first one you can try something like this:

    #header #ajaxsearchprowidget-6 {
      left: 50%;
      padding-top: 0;
      position: absolute;
      top: 0;
      transform: translate(-50%);
      z-index: 999;
    } 

    Best regards,
    Rikard

    #771814

    I am trying to do the exact same thing as the original poster. This is what I have in my functions:

    
    add_action( 'ava_after_main_menu', 'enfold_customization_header_widget_area' );
    function enfold_customization_header_widget_area() {
    	dynamic_sidebar( 'header' );
    	dynamic_sidebar( 'header2' );
    }
    

    the widgets are named header and header2 this is my css:

    #header .widget {
      left: 50%;
      padding-top: 10;
      position: absolute;
      top: 0;
      transform: translate(-50%);
      z-index: 999;
    }
    
    #header2 .widget {
      left: 90%;
      padding-top: 10;
      position: absolute;
      top: 0;
      transform: translate(-50%);
      z-index: 999;
    }

    Problem is my images are right on top of each other. I am assuming my css needs to be altered on header2.

    Thoughts?

    #772049

    Hi!


    @johnworfin
    Please inspect elements on your widgets and target them using ID’s – http://i.imgur.com/UzrzBfJ.png
    In the example above, selector should be

    #header #text-14 { opacity: 0.5; }

    Regards,
    Yigit

    #772598

    Thank you-that pointed me in the right direction.

    #772611

    Well, the css works fine with my first added header widget, but not the second one:

    #header #text-2 {
    left: 50%;
    padding-top: 10;
    position: absolute;
    top: 0;
    transform: translate(-50%);
    z-index: 999;
    }

    #headerB #text-6 {
    left: 50%;
    padding-top: 10;
    position: absolute;
    top: 0;
    transform: translate(-75%);
    z-index: 999;
    }

    It’s ignoring the css for whatever reason. I have triple checked the code, and it is text-6.

    a screen shot-the second header image is behind the logo ignoring css.

    #772689

    Hi,

    Your code should be as following

    #header #text-2 {
    left: 50%;
    padding-top: 10;
    position: absolute;
    top: 0;
    transform: translate(-50%);
    z-index: 999;
    }
    
    #header #text-6 {
    left: 50%;
    padding-top: 10;
    position: absolute;
    top: 0;
    transform: translate(-75%);
    z-index: 999;
    }

    Best regards,
    Yigit

    #772694

    getting there, but now my image to the far right is getting shrunk instead of displaying at full size. How do I get it to go to the far right and stay at full size?

    • This reply was modified 7 years, 7 months ago by johnworfin.
    #772761

    My current css:

    #header #text-2 {
    left: 50%;
    padding-top: 10;
    position: absolute;
    top: 0;
    transform: translate(-50%);
    z-index: 999;
    }
    
    #header #text-6 {
    left: 85%;
    padding-top: 10;
    position: absolute;
    top: 0;
    transform: translate(-75%);
    z-index: 999;
    }
    #772835

    never mind-I figured it out, the search icon from the main menu was reducing the size of my image. Is there any way to move the main menu to where the secondary menu is? At the top?

    Thanks,

    #773237

    Hi,

    Replied to your thread here – https://kriesi.at/support/topic/how-to-disable-main-menu/
    Let us continue there :)

    Best regards,
    Yigit

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Adding multiple widget areas to the header’ is closed to new replies.