Viewing 24 posts - 1 through 24 (of 24 total)
  • Author
    Posts
  • #885215

    Hello,

    we have set menu items to display as a icon on desktops and we would like to add polylang switch next to it, before (or after) social icons.

    I’ve already tried following your guide to add a widget to a header area but that leads to an error:

    Warning: Cannot modify header information – headers already sent by (output started at /home/…functions.php:7) in /home/…/wp-admin/includes/misc.php on line 1114

    Best regards

    #885525

    Hey digizel,

    Can you show us what code you tried?

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #885546

    Hello,

    I’ve tried adding this code to functions.php:

    add_action( ‘ava_after_main_menu’, ‘enfold_customization_header_widget_area’ );
    function enfold_customization_header_widget_area() {
    dynamic_sidebar( ‘header’ );
    }

    I have created an admin account so you can have a look.

    Best regards

    #885666

    Hi digizel,

    You can add the language switcher to the menu
    https://cl.ly/3X1N1I402d0d

    https://polylang.pro/doc/the-language-switcher/

    The code for the widget in the header is correct, there must have been some warning that was output and so it seemed to break stuff.

    You could also edit the helper-main-menu.php in a child theme and put the code there.
    If you need further assistance please let us know.
    Best regards,
    Victoria

    • This reply was modified 6 years, 11 months ago by Victoria.
    #885673

    Hello,

    we have already added the switcher to the menu but that’s not really visible enough and that is why we asked how to add it next to burger menu icon.

    Are you saying that we cannot add a custom widget area to header?

    Can we use the position for search icon?

    Best regards

    #885719

    Hi digizel,

    I did not say that. I said that the code for the widget is working and that the other option is to edit the theme files.

    Best regards,
    Victoria

    #885736

    Ok, so what do I need to do the have a widget area in the header, next to the social icons?

    #885850

    Hi,

    Please refer to the following:

    Best regards,
    Jordan Shannon

    #886028

    I’ve already tried that and it’s leads to an error like I’ve described in the first message:

    Warning: Cannot modify header information – headers already sent by (output started at /home/dh_zg80dh/zagreb80.com/wp-content/themes/zg80/functions.php:7) in /home/dh_zg80dh/zagreb80.com/wp-admin/includes/misc.php on line 1114

    Best regards

    #886622

    Hi,

    Something on the code has a blank state on top, that is why the issue exists.
    You would need to fix your code.

    Best regards,
    Basilis

    #886768

    Hello,

    ok, and how do I fix the code?

    #886786

    Hi digizel,

    In order to have the code in your functions.php you need to use a child theme and add the code there. Otherwise the code you add in the parent theme, it will be overwritten by the next update.

    Best regards,
    Victoria

    #886791

    I have a child theme in place and I have added the code to functions.php.

    I’ve also added custom widget area named header and after that, this is what I get in the backend:

    add_action( ‘ava_after_main_menu’, ‘enfold_customization_header_widget_area’ ); function enfold_customization_header_widget_area() { dynamic_sidebar( ‘header’ ); }
    Warning: Cannot modify header information – headers already sent by (output started at /home/dh_zg80dh/zagreb80.com/wp-content/themes/zg80/functions.php:7) in /home/dh_zg80dh/zagreb80.com/wp-admin/includes/misc.php on line 1114

    Warning: Cannot modify header information – headers already sent by (output started at /home/dh_zg80dh/zagreb80.com/wp-content/themes/zg80/functions.php:7) in /home/dh_zg80dh/zagreb80.com/wp-includes/pluggable.php on line 1216

    #886831

    Hi,
    First you will need to remove the code you added to the functions.php via FTP.
    Then can try to understand why you are getting the error, do you have more that one custom widget?

    Best regards,
    Mike

    #886872

    Hello,

    I’ve noticed that I’ve made an error when I previously copied the code so now I don’t get any errors :)

    I’ve added the polylang switcher to custom widget area named header but I don’t see anything on the page.

    Please note that I haven’t done any other theme file modification and the cache plugin has been disabled.

    I would appreciate if you can have a look and let me know if there is something wrong or missing.

    Best regards

    • This reply was modified 6 years, 11 months ago by digizel.
    #886942

    Hi,
    I see your flags are showing in your burger menu, and your main menu is disabled.
    The option is to put the language items in the secondary menu and set the secondary menu to the top of the page, which I did.
    But it is not showing as it should. Also your theme options don’t show the “Menu Items for mobile” option and I see no css to set your burger menu to always on. So there is a conflict somewhere.
    Did you make changes to the parent theme? Perhaps try disabling your plugins. If that resolves the issue, reactivate each one individually until you find the cause.
    Otherwise I would recommend re-uploading the parent theme to correct any broken files.

    Best regards,
    Mike

    #886952

    Hello,

    the parent theme is enfold 4.2 and I haven’t made any modifications there. I did changed the option for child theme: zg80>Main menu>General>Menu Items for Desktop to “Display as icon” because my client prefers the burger menu. You can see that in the attached screenshot.

    Previously I’ve also added Polylang switcher to the menu but only as a temporally solution until we can show it somewhere else in the header.

    Would it be possible to have a widget instead of search as we don’t need that?

    I have already disabled all plugins except Polylang so that shoudn’t cause any troubles.
    br

    #886966

    Hi,
    Thanks for the feedback, I see that I missed that, and with using the “Display as icon” setting the Extra Elements > Header Secondary Menu is also hidden. Which now makes sense.
    You can add a widget to the header, see here.
    Or how about setting the menu back to display as text and using this code to show the burger menu:

    @media only screen and (max-width: 1990px) {
    .av-burger-menu-main { 
         display: block!important; 
    }
    #top .av_mobile_menu_tablet .av-main-nav .menu-item {
         display: none!important;
    }}

    Then the Extra Elements > Header Secondary Menu will show, which has the language switcher in it.

    Best regards,
    Mike

    #886972

    The client prefers to add the language switch to the header so it can we always visible. I’ve already followed the guide on how to add widget to the header are:

    1. I’ve added the following code to the function.php of the child theme: add_action( ‘ava_after_main_menu’, ‘enfold_customization_header_widget_area’ ); function enfold_customization_header_widget_area() { dynamic_sidebar( ‘header’ ); }

    2. I’ve added the polylang switcher to custom widget area named header

    I can now see the widget with icon for languages but they are located under the logo. How do I move them in the same line as the burger menu? Preferred position would be left of right to the burger menu.

    Best regards

    #887031

    Hi,
    I don’t see the language widget, please check.

    Best regards,
    Mike

    #887076

    Well, there is clearly a flag icon in the lower left corner of the logo.

    #888222

    Hi,

    Please adjust the left position of the header widget.

    #header .widget {
        left: 80%;
    }

    Use additional css media queries to adjust the widget position on mobile view.

    Best regards,
    Ismael

    #888285

    Thank you for your support.

    Best regards

    #888411

    Hi digizel,

    Glad we got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

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