Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #745650

    Is it possible to add multiple widgets to the header area or will it break the theme? I already have one on the right… but was hoping to add one to the left as well. I’m following this thread http://kriesi.at/documentation/enfold/adding-a-widget-area-to-the-header/

    #747012

    Hey

    You can create two widget areas “header” and “header-left” and change the code to following one

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

    Best regards,
    Yigit

    #747079

    Ahoy,

    When I add a new snippet with that code or add this to snipper with the right header I get this error

    Don’t Panic

    The code snippet you are trying to save produced a fatal error on line 10:

    Cannot redeclare enfold_customization_header_widget_area() (previously declared in /home/sunseek4/public_html/wp-content/plugins/code-snippets/php/admin-menus/class-edit-menu.php(202) : eval()’d code:3)
    The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.

    Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.

    Please Advise

    #747116

    Hi!

    Please try it as follow

    add_action( 'ava_after_main_menu', 'pw_enfold_customization_header_widget_area' );
    function pw_enfold_customization_header_widget_area() {
    	dynamic_sidebar( 'header' );
    	dynamic_sidebar( 'header-left' );
    }

    Let us know if there is anything else we can do for you.

    Best regards,
    Basilis

    #747205

    So when I add that it creates another instance of the first header widget which you can see in the screenshot, I dont know why… I named the new widget header-left. This is the shortcode I added, how do I make it left and not display the phone number?

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

    Please Advise

    #748055

    Hi,

    Please change the code to following one

    #header .widget {
        padding-top: 0;
        position: absolute;
        z-index: 999;
    }
    #header #text-6 { 
        right: -40px;
        top: -30px;
        transform: translate(-50%);
    }
    #header #text-7 { 
        right: -10px;
        top: -20px;
        transform: translate(-50%);
    }

    Best regards,
    Yigit

    #748133

    Hello, I added that code but nothing has changed really. The widget is not in the top left and it is still duplicating the first widget. Please advise

    #748426

    Hi,

    That was because you forgot to remove the code you previously added. I removed it. Please adjust the values to change the position of your widgets

    Best regards,
    Yigit

    #748655

    Hi @yigit,

    When I load my page I still see the phone number widget inside the new left widget. I’m pretty confused… What I wanted was one widget in the top right that was the phone number and another widget in the top left that had completely different content in it. The widget is still duplicating the first widget which I do not want. As you can see from my backend widget screenshot that phone numebr shouldn’t be there… screenshot 1 and screenshot 2

    Please Advise

    #751261

    Hi!

    We added this css code to adjust the position of the phone number widget.

    #header #text-6 {
        left: 80px;
        top: -30px;
        transform: translate(-50%);
    }

    Best regards,
    Ismael

    #751276

    Hey @ismael,

    So I think there is some confusion still…. I want to separate header widgets that have different content inside of them. The left header widget will not have the phone number in it… it will be totally different from the top right widget… Make sense? The code I made in the previous screenshots shows that there is no phone shortcode which I do not want in the left widget. Here is a screenshot mock of what I want… hope this makes sense…

    Please Advise

    #752137

    Hi!

    There are already 2 widgets in the header. The id of the phone number widget is “#text-6” and other is “#text-7”. If you want to move the left widget, use the following css code.

    #header #text-7 {
        left: 20px;
        top: -20px;
    }

    Adjust the values as needed.

    Best regards,
    Ismael

    #752508

    Hi,

    So what I adds that code it just makes the “left widget” disappear. I try and adjust the values but nothing happens. But the double phone number is there…why is this?????? I dont want the phone number twice like i mentioned in my previous posts. See screenshot.

    #752751

    Hi!

    The phone number is duplicated because you added the dynamic_sidebar( ‘header’ ) twice. And we also removed the following css code.

    #header #text-7 { 
        right: -10px;
        top: -20px;
        transform: translate(-50%);
    }

    1

    Best regards,
    Ismael

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.