Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #990968

    Hello!
    My client would like to set up the menu as per the screenshot in the private area. Please advise. Thank you in advance.

    #991003

    Hey webWahine,
    Do you already have the button in the header? We can assist with moving it and the social icons to the left of the menu with some javascript.
    Please link to the page so we can take a closer look.

    Best regards,
    Mike

    #991261

    This isn’t the site I want to change since it’s live so here’s an example of a main menu with a bordered button and social in the default locations (private). Thanks again! :)

    #991306
    #991311

    Hi,


    @Guenni007
    Thank you for the link!

    Best regards,
    Basilis

    #991561

    Yes, that is part of it but not quite. I’d like to have social, then a colored button, and then the burger menu, left to right –

    http://holborn.ca/images/screen.jpg

    #991795

    Hi,
    I took a look at your link above in the Private Content area, but the menu, and button doesn’t look like the same setup as in your image. Please link to the live site so we see the current placement.

    Best regards,
    Mike

    #991896

    the most easiest way would be to register a new social media button for example with a lock and have the rounded buttons as if it was a social media link – on hovering you can see the tooltip : registering.
    i do this often for links like intranet link or login links.
    this could be handeled than like on my link above – because than it is part of social-media list.

    See here Result ( i do not change to see only burger-menu – so have a look at smaller screensizes )
    https://webers-testseite.de/cynthia/

    if you like to insert for example a whole avia button shortcode – that is possible too.

    add_action('ava_inside_main_menu', function() {
      echo '<li class="registerbutton">';
      echo do_shortcode("[av_button label='Register now' link='manually,#' link_target='' size='large' position='left' label_display='' icon_select='yes-right-icon' icon_hover='aviaTBicon_hover' icon='ue875' font='entypo-fontello' color='custom' custom_bg='#42ab96' custom_font='#ffffff' av_uid='av-b9l' custom_class='' admin_preview_bg='']");
      echo '</li>';
    });
    
    function change_menu_position() { 
    ?>
    <script>
    (function($){
    	$('.main_menu ul.social_bookmarks').insertBefore($('.main_menu div.avia-menu'));
    	$('li.registerbutton').appendTo('.main_menu > .social_bookmarks');
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'change_menu_position');

    the code can be obtained by activation of the debug mode on enfold for above rules
    echo do_shortcode(" into this comes the full shortcode of your avia button ");

    this comes to quick css:

    /*** this is for the new button not to have same behavior as social_bookmarks buttons ***/
    .registerbutton { width: auto !important }
    .registerbutton .avia_button_icon { display: inline-table }
    .social_bookmarks li.registerbutton a { border-radius: 0 !important; padding: 0 10px !important; width: auto !important; background: #42ab96; color: #fff }
    
    /*** rules for the left-hand social_bookmarks buttons ***/
    #top nav .social_bookmarks { margin-top: -20px !important; overflow: visible !important; height: 40px !important }
    .avia-menu.av_menu_icon_beside { padding-right: 0; margin-right: 0; border-right-width: 0; border-right-style: none }
    .social_bookmarks li a { height: 40px !important; line-height: 40px !important; width: 40px !important }
    #top .social_bookmarks li { width: 40px; height: auto !important }
    #top .av-logo-container .social_bookmarks li a {  border-radius: 50% }
    .av_header_transparency .social_bookmarks li a { color: #969696 !important;}
    #991922

    here is the method mentioned above :

    register a new social_bookmark via functions.php of your child theme
    here i take the lock but find a different icon on enfold

    function avia_add_custom_icon($icons) {
        $icons['register']  = array( 'font' =>'entypo-fontello', 'icon' => 'ue825');
        return $icons;
    }
    add_filter('avf_default_icons','avia_add_custom_icon', 10, 1);
    
    function avia_add_custom_social_icon($icons) {
        $icons['Register'] = 'register';
        return $icons;
    }
    add_filter('avf_social_icons_options','avia_add_custom_social_icon', 10, 1);

    goto your Enfold options and add that newly added “social media” (it is at the end of the list) and insert your desired link

    this turns the social_media to the left of hamburger menu – put it in functions.php of your child theme too

    function change_menu_position() { 
    ?>
    <script>
    (function($){
    	$('.main_menu ul.social_bookmarks').insertBefore($('.main_menu div.avia-menu'));
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'change_menu_position');

    now style your newly social media button!:

    /*** this is for the new button not to have same behavior as social_bookmarks buttons ***/
    .social_bookmarks_register.av-social-link-register {
        margin: 0 15px;
        width: auto !important;
        padding: 0 15px !important;
        background-color: #42ab96 !important;
    }
    
    #top .social_bookmarks li.social_bookmarks_register a {
        width: auto !important;
        color: #fff;
    }
    
    .social_bookmarks_register .avia_hidden_link_text {
        display: inline !important;
        padding-left: 10px;
        text-decoration : none !important
    }
    
    #top #wrap_all .av-social-link-register:hover  {
        color: #fff;
        background-color: #BD5469 !important;
    }
    /*** rules for the left-hand social_bookmarks buttons ***/
    #top nav .social_bookmarks { margin-top: -20px !important; overflow: visible !important; height: 40px !important }
    .avia-menu.av_menu_icon_beside { padding-right: 0; margin-right: 0; border-right-width: 0; border-right-style: none }
    .social_bookmarks li a { height: 40px !important; line-height: 40px !important; width: 40px !important }
    #top .social_bookmarks li { width: 40px; height: auto !important }
    #top .av-logo-container .social_bookmarks li a {  border-radius: 50% }
    .av_header_transparency .social_bookmarks li a { color: #969696 !important;}

    I think this will be the better and better understanding way:
    Result – same as above: https://webers-testseite.de/cynthia/

    #992660

    Hi,

    You can’t get more comprehensive than that. Thanks @Guenni007! :)

    Best regards,
    Ismael

    #992945

    i would prefer the last method to make another “social button” and style it a different way.

    #992950

    Thank you so much! I’m away on holiday and will look at this very carefully when I get home, and let you know if I have any further questions. The image is what I’m trying to achieve and the link to the test site is indeed styled differently :)

    #993119

    Hi,


    @webWahine
    ; great, let us know if you should need any further help on the topic. Thanks @guenni007 for helping out as always :-)

    Best regards,
    Rikard

    #1037325

    Hello, all! Sorry it’s been so long! It turns out that my client has decided that he doesn’t want the social icons after all, so it would just be a matter of adding one ‘REGISTER’ button before the burger menu. Guenni007, you are very helpful here but are you able to strip out the need for the social and perhaps show me a more simple way of adding just the one button?

    The site is now a work in progress (see private), but it’s the same as the screenshot.

    Thanks, again :)

    #1037768

    Hello, again

    I figured it out except for one very simple question, please. I looked at the docs and added this to my functions.php in my child theme directory –

    <?php
    
    //--------------------------------
    
    // Header widget area
    
    //--------------------------------
    
    add_action( 'ava_after_main_menu', 'enfold_customization_header_widget_area' );
    function enfold_customization_header_widget_area() {
    dynamic_sidebar( 'header' );
    }
    
    ?>

    Then I created a new widget called ‘header’, and added in some basic custom HTML to create a text link –

    Register Now

    Then I added the css to style and adjust the position of the register ‘button’ –

    /* Widget text and background */
    
    #top #header #header_main .widget {
        line-height: 88px; /* tweaks the vertical height of the text */
        color: red;
        /* background: green; just to see where it sits on the screen */
    	text-align: right;
    	margin-right: 80px;
    	min-height: 150px; /* same as custom main menu height */
    }
    
    /* Widget title */
    
    #top #header #header_main .widget h3.widgettitle {
        color: #ff00ff;
    }
    
    /* Widget link */
    
    #top #header.header_color #header_main .widget a {
    	font-family: 'interstate-regular';
    	font-weight: normal;
    	font-style: normal;
    	font-size: 15px;
    	letter-spacing: 4px;
    	text-decoration: none;
    	text-transform: uppercase;
        color: #41ab97;
    	padding: 5px 15px;
    	border: 1px solid #41ab97;
    	min-width: 240px; /* using this to make all site buttons the same width */
    }
    
    #top #header.header_color #header_main .widget a:hover {
        background: #41ab97;
        color: #fff;
    }
    
    /* widget id - does the same as text & bg, above */
    
    #custom_html-6 {
    
    }
    

    It worked perfectly, but when scaling down to mobile, I’ve added in a gray background just to see what it’s doing and I’m trying to reduce the height of the widget block – I set it to 75 (half of what it is on desktop), but it’s not taking effect. Of course, I could simply hide the gray background and it’s sitting perfectly with some tweaking to the css, but I’d like to know how to target that gray area to make it a smaller height. Here’s what I have but the max-height is not working.

    I’d like to know how to target that gray to make it 75 or something close to that :)

    /************************** break point 989 *******************/
    
    @media only screen and (max-width: 989px) {
    	/* start */
    
    /* Widget text and background */
    	#top #header #header_main .widget {
    	    background: gray;		
    	    line-height: 30px; /* reduced vertical height - 88px for desktop */
    		margin-right: 60px;
    		max-height: 75px !important;  /* reduced from desktop size of 150 custom main menu height */
    	}
    
    /* end max 989 */
    }

    And then on smaller mobile I simply hide the widget –

    /************************** mobile to tablet portrait *******************/
    
    @media only screen and (max-width: 767px) {
    	/* start */
    
    	/* Widget text and background - hide register button */
    
    	#top #header #header_main .widget {
    		display: none !important;
    	}				
    
    	/* end max 767 */	
    }
    
    #1038807

    Hi,
    I took a look at your gray section and found another snippet setting it’s height by using the same classes.
    In order to overcome this, please try this css:

    @media only screen and (max-width: 989px) {
    #top #header #header_main .widget {
        background: gray;
        line-height: 30px;
        margin-right: 60px;
        max-height: 75px !important;
        min-height: 75px !important; 
    }
    }

    notice I have added a “min-height” for the same height. This is not typical, but it works in your case.
    Please clear your browser cache and check.

    Best regards,
    Mike

    #1039064

    That worked perfectly! Thank you so much :)

    #1039090

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘Add social and a button before burger’ is closed to new replies.