-
AuthorPosts
-
June 20, 2024 at 1:46 pm #1452300
Hey!
I want to create a right sidebar header just like the one on this website (only mine will be on the right side and not on the left side, sticky header and everything)
https://www.ebnlaw.co.il/How can I do that?
thank you!
RachelJune 20, 2024 at 3:47 pm #1452441Hey Reut,
There’s nothing exactly like that in the theme by default unfortunately, the closest thing would be this demo: https://kriesi.at/themes/enfold-photography/. You can set the layout under Enfold->General Layout->Layout.
Best regards,
RikardJune 21, 2024 at 8:34 am #1453542Hey Rikard,
I already know all that. That’s why I wrote to you in the first place.
I’ll be more specific.How can I (with code) make these things happen?
1. Change the width of the right sidebar header.
2. Change the right-side menu to a hamburger menu.Thank you
ReutJune 21, 2024 at 12:04 pm #1453722Hi,
Thanks for the update. Customisations like that would be out of scope of theme support, but if you should get stuck along the line then we might be able to help you out.
Best regards,
RikardJune 21, 2024 at 1:00 pm #1453787Hi,
Customizations like changing the sidebar header width and the regular menu to be an icon menu are out of the theme support?
The theme support helped me before with much more complicated changes.
And I assisted on threads here from other people’s questions and solved a lot more difficult issues.You can’t even tell me Where on the header.php file I would be able to do it myself?
June 21, 2024 at 2:08 pm #1453865Hi,
If you only want to change the width, then you can try CSS like this:
.html_header_sidebar #top #header { width: 400px; }
Best regards,
RikardJune 21, 2024 at 7:30 pm #1454195Thank you.
I’ve tried it, the width is smaller, but now the site isn’t responsive and the content and the footer aren’t adjusting to the new position.
Also, the social links, aren’t adjusting, and instead of being positioned one under the other, they are beside each other, and not all of them are showing
(I’ve added a pic in the private content for you to see)June 22, 2024 at 10:04 pm #1455912Hi,
This is quite tricky but perhaps this might get you started and you can adjust further to suit. Using a Menu And Logo Position of Logo left & menu right, & a sticky header with no topbar – If you are not using a child theme you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:
and ensure that it is activated, then add this code and save.function create_a_sidebar_header_with_burger_menu() { ?> <script> document.addEventListener('DOMContentLoaded', function() { // Check if the HTML element has the "wp-toolbar" class if (document.documentElement.classList.contains('wp-toolbar')) { return; // Exit the script if "wp-toolbar" class is found } // Create the main toolbar div const toolbar = document.createElement('div'); toolbar.id = 'right-toolbar'; // Create the inner content divs for (let i = 1; i <= 3; i++) { const contentDiv = document.createElement('div'); contentDiv.className = 'toolbar-content'; contentDiv.id = 'content' + i; toolbar.appendChild(contentDiv); } // Append the toolbar to the body document.body.appendChild(toolbar); // Add the CSS styles const style = document.createElement('style'); style.innerHTML = ` #right-toolbar { position: fixed; right: 0; top: 0; width: 100px; height: 100%; background-color: #f8f8f8; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 20px 0; box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5); z-index: 999; } #content1 .main_menu { position: relative; } .toolbar-content { width: 80px; height: 100px; background-color: #f8f8f8; margin-bottom: 10px; border-radius: 5px; display: flex; justify-content: center; align-items: center; } .toolbar-content:last-child { margin-bottom: 0; } .rotated-logo { transform: rotate(90deg); transform-origin: center; } #content2 .logo { float: none; position: relative; left: unset; height: unset; } #content3 .social_bookmarks { transform: rotate(90deg); transform-origin: center; } .html_header_top.html_header_sticky #main { padding-top: 0; } #av_section_1 { height: 100vh; } #menu-item-shop,#menu-item-search { display: none; } #top #content1 .av-small-burger-icon { transform: scale(1); } .html_cart_at_menu.html_main_nav_header #top .main_menu .menu>li:last-child { padding-right: 0; margin-right: 0; } .avia-menu.av_menu_icon_beside { padding-right: 0; margin-right: 0; border-right-width: 0; border-right-style: none; } .html_av-overlay-side-classic #top .av-burger-overlay li a { border-bottom-style: none; } @media only screen and (min-width: 768px) { .responsive #top #content1 .av-main-nav .menu-item-avia-special.av-burger-menu-main { display: block!important; } #top #content1 .av-main-nav > li.menu-item { display: none!important; } #content1 .av-main-nav-wrap { float: right; } } #header { visibility: hidden; } `; document.head.appendChild(style); // Move the logo to #content2 and rotate it const logo = document.querySelector('.avia-standard-logo'); if (logo) { const content2 = document.getElementById('content2'); content2.appendChild(logo); logo.classList.add('rotated-logo'); } // Move the menu to #content1 const menu = document.querySelector('.main_menu'); if (menu) { const content1 = document.getElementById('content1'); content1.appendChild(menu); } // Move the social bookmarks to #content3 const socialBookmarks = document.querySelector('.social_bookmarks'); if (socialBookmarks) { const content3 = document.getElementById('content3'); content3.appendChild(socialBookmarks); } }); </script> <?php } add_action( 'wp_footer', 'create_a_sidebar_header_with_burger_menu', 99 );
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
This should give you a sidebar header with the burger menu, logo & social icons like this:
and the burger menu should open like this:
It probably needs some more css, but perhaps you can give it a try.Best regards,
MikeJune 23, 2024 at 8:31 am #1456600Hi Mike!
Thank you so much for your help.
4 things, I would appreciate your help with:
1. The new sidebar is overlapping the content of the website, how can I add some clear margin to the sidebar menu?
2. The social links are not exactly inside the header. There is some pudding on the right, how can I remove it?
3. How can I remove the space between the menu links so more of the menu will be showing without scrolling?
4. The new header is also showing on small screens. I need a regular header under 767px (with a different logo since I’ve changed it to be shown upright and not on the side).Thank you so much!
June 23, 2024 at 6:21 pm #1457354Hi,
To change this so it only works on screens larger than 768px I changed the code to this, which also adds some body margin so it won’t overlap the page content, and I make the menu items closer and I adjusted the social icons, please check.function create_a_sidebar_header_with_burger_menu() { ?> <script> document.addEventListener('DOMContentLoaded', function() { // Check if the HTML element has the "wp-toolbar" class if (document.documentElement.classList.contains('wp-toolbar')) { return; // Exit the script if "wp-toolbar" class is found } // Check if the screen width is larger than 768px if (window.innerWidth < 768) { return; // Exit the script if the screen width is less than 768px } // Create the main toolbar div const toolbar = document.createElement('div'); toolbar.id = 'right-toolbar'; // Create the inner content divs for (let i = 1; i <= 3; i++) { const contentDiv = document.createElement('div'); contentDiv.className = 'toolbar-content'; contentDiv.id = 'content' + i; toolbar.appendChild(contentDiv); } // Append the toolbar to the body document.body.appendChild(toolbar); // Add the CSS styles const style = document.createElement('style'); style.innerHTML = ` #right-toolbar { position: fixed; right: 0; top: 0; width: 100px; height: 100%; background-color: #f8f8f8; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 20px 0; box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5); z-index: 999; } #content1 .main_menu { position: relative; } .toolbar-content { width: 80px; height: 100px; background-color: #f8f8f8; margin-bottom: 10px; border-radius: 5px; display: flex; justify-content: center; align-items: start; } .toolbar-content:last-child { margin-bottom: 0; } .rotated-logo { transform: rotate(90deg); transform-origin: center; } #content2 .logo { float: none; position: relative; left: unset; height: unset; } #content3 .social_bookmarks { /*transform: rotate(90deg);*/ transform-origin: center; } .html_header_top.html_header_sticky #main { padding-top: 0; } #av_section_1 { height: 100vh; } #menu-item-shop,#menu-item-search { display: none; } #top #content1 .av-small-burger-icon { transform: scale(1); } .html_cart_at_menu.html_main_nav_header #top .main_menu .menu>li:last-child { padding-right: 0; margin-right: 0; } .avia-menu.av_menu_icon_beside { padding-right: 0; margin-right: 0; border-right-width: 0; border-right-style: none; } .html_av-overlay-side-classic #top .av-burger-overlay li a { border-bottom-style: none; } @media only screen and (min-width: 768px) { .responsive #top #content1 .av-main-nav .menu-item-avia-special.av-burger-menu-main { display: block!important; } #top #content1 .av-main-nav > li.menu-item { display: none!important; } .html_av-overlay-side #top .av-burger-overlay li { margin: 0; height: 50px; } #content1 .av-main-nav-wrap { float: right; } } #header { visibility: hidden; } body { margin-right: 100px } #content3 { height: 300px; } #top .social_bookmarks li { display: inline-block; clear: both; margin-bottom: 10px; } `; document.head.appendChild(style); // Move the logo to #content2 and rotate it const logo = document.querySelector('.avia-standard-logo'); if (logo) { const content2 = document.getElementById('content2'); content2.appendChild(logo); logo.classList.add('rotated-logo'); } // Move the menu to #content1 const menu = document.querySelector('.main_menu'); if (menu) { const content1 = document.getElementById('content1'); content1.appendChild(menu); } // Move the social bookmarks to #content3 const socialBookmarks = document.querySelector('.social_bookmarks'); if (socialBookmarks) { const content3 = document.getElementById('content3'); content3.appendChild(socialBookmarks); } }); </script> <?php } add_action( 'wp_footer', 'create_a_sidebar_header_with_burger_menu', 99 );
Best regards,
MikeJune 23, 2024 at 7:32 pm #1457378i can not see how the example page looks like – no chance to open it on my end her. Maybe there is no valid cert to open it with https.
June 23, 2024 at 7:46 pm #1457383June 23, 2024 at 7:57 pm #1457386maybe my browser settings are stricter against unsafe sites.
__________
What functionality does the hamburger button have – does it then go even further out?June 23, 2024 at 8:00 pm #1457387Hi,
this is what I tried to do.Best regards,
MikeJune 24, 2024 at 11:00 am #1457874Hey Mike!
Thank you so much for all your help!
I have two things that I need your help with:
1. on screens under 768, the logo image is regular and not 90 degrees to the right, as with the changes we made. I need them to look the same, so is there a way for the logo on screens under 768 px, to be 90 degrees to the right or maybe to change the image to a different one? (the second option I know is possible I already did it on a different website, I don’t know on which thread here I saw the code to do it)
2. The links on the menu are a bit off, when I press the second link the third opens.I’ve added a pic of a mobile screen (to see the logo) and a screen record (for the menu)
Thank you so so so much for all the help.
Reut RachelJune 24, 2024 at 3:36 pm #1458239I have a pure css approach! ( and some little snippets for functions.php )
I also assume the header setting : logo left menu right.
I set the whole thing to position fixed across all screen widths and give all backgrounds a transparency.
I set the logo container to display: none.What I now create is a widget and place it at the bottom using hook: ava_after_footer_output. I style it so that I have a bar on the right (or left – depending on your preference) and set it to fixed.
The advantage is that I can now easily place different things in the widget area. Logo, social links, etc.
if there is interest I can post the code here.June 24, 2024 at 8:57 pm #1458521June 24, 2024 at 10:29 pm #1458528Top Header – Logo left – menu right.
to have on start to all pages first the hamburger active and to generate the widget area – this to child-theme functions.php:function custom_burger_menu_active( $active, $context ){ return true; return $active; } add_filter('avf_burger_menu_active', 'custom_burger_menu_active', 10, 2 ); add_action('ava_after_footer_output', function() { echo '<div id="extra_sidebar" class="container_wrap extra_sidebar_color" role="contentinfo" ><div class="container" style="text-align: center; padding: 10px 0 20px">'; echo do_shortcode("[av_sidebar widget_area='extra_sidebar']"); echo '</div></div>'; });
this is for social bookmarks a shortcode to place inside a text-widget :
function social_bookmarks_shortcode() { $social_args = array('outside'=>'ul', 'inside'=>'li', 'append' => ''); $social = avia_social_media_icons($social_args, false); return $social; } add_shortcode('social-bookmarks', 'social_bookmarks_shortcode');
to use it as :
[social-bookmarks]
now goto your widgets and create a new widget area : extra_sidebar
!!! to have on top a free space not to overlap the hamburger icon i placed to that a text-widget on top with an empty div container:
here is the css code: you can fit to your needs the amount of that extra bar:
.responsive #top #wrap_all #header { position: fixed !important; height: 100px !important; } .html_header_top #top #header .container { width: 100% !important; padding: 0; max-width: 100% !important; } .html_header_top #top #header .main_menu, .html_header_top #top #header .av-main-nav-wrap, .html_header_top #top #header .av-burger-menu-main { width: 100px; margin: 0 !important; } .html_header_top #top #header .av-burger-menu-main a { padding: 0 !important; text-align: center; } #top #header_main > .container, #top #header_main > .container .main_menu .av-main-nav > li > a, #top #header_main #menu-item-shop .cart_dropdown_link { height: 100px !important; line-height: 100px !important; } .header_color .header_bg, .header_color .main_menu ul ul, .header_color .main_menu .menu ul li a, .header_color .pointer_arrow_wrap .pointer_arrow, .header_color .avia_mega_div, .header_color .av-subnav-menu > li ul, .header_color .av-subnav-menu a { background-color: transparent !important; } .html_header_top.html_header_sticky #top #wrap_all #header { box-shadow: none } .html_header_top.html_header_sticky #top #wrap_all #main { padding-top: 0px !important; } .html_av-overlay-side #top .av-burger-overlay-scroll { background-color: rgba(0,0,0,0.5) !important; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); } .responsive #top .av-logo-container .logo { display: none !important; } #extra_sidebar { display: block; position: fixed; width: 100px !important; height: 100%; top: 0; right: 0px; left: auto; background-color: #FFF; z-index: 302 !important; } #extra_sidebar .container { height: 100%; } .html_header_top #top #wrap_all #main { width: calc(100% - 100px); padding-top: 0px !important; } #top #extra_sidebar .avia-builder-widget-area { display: flex !important; flex-flow: column nowrap; justify-content: space-around !important; height: 90%; padding-top: 250px !important; /*** try your self a good looking value ******/ } #top #extra_sidebar .avia-builder-widget-area:before, #top #extra_sidebar .avia-builder-widget-area:after { display: none; } #top #extra_sidebar .avia-builder-widget-area > * { flex: 0 1 auto; -ms-writing-mode:tb-rl; writing-mode:vertical-rl; /*! transform:rotate(180deg); */ } #top #extra_sidebar .avia-builder-widget-area svg, #top #extra_sidebar .avia-builder-widget-area img { width: auto; height: 70px; transform: rotate(90deg); transform-origin: top right; margin-right: 15px; } #top #extra_sidebar .widget ul.social_bookmarks { transform: rotate(90deg) !important; } #top #extra_sidebar .widget ul.social_bookmarks li a { transform: rotate(-90deg) !important; } @media only screen and (min-width: 768px) and (max-width: 989px) { .responsive.html_mobile_menu_tablet.html_header_top.html_header_sticky #top #wrap_all #main { padding-top: 0px; } }
I don’t know whether existing rules have played a role here. If it doesn’t work right away, please contact me again.
June 24, 2024 at 11:11 pm #1458532Hi,
Thanks the is pretty good, probably better that my approach, see my text here:
My test ▸ https://enfold.savvyify.com/guenni007-sidebar-header/
I probably need a little more css, but thank you for sharing :)Best regards,
MikeJune 25, 2024 at 4:56 am #1458544Hey Mike!
Thank you so much for all your help!
Can you please help me? since it is my thread and problem in the first place.
it really is the last thing I need your help with in this problemThe links on the menu are a bit off, when I press the second link the third opens.
I’ve added a screen record
Thank you so so so much for all the help.
Reut RachelJune 27, 2024 at 4:01 am #1459799Hi,
Thank you for your patience, I believe that it is sorted out now, please clear your browser cache and check.Best regards,
MikeJune 27, 2024 at 12:00 pm #1459854Hi!
Thank you again for all your help.
Now it is fixed.
However,
Now there is a problem with the color section.
I’ve edited the section’s height to be on some portfolio pages 100%, on some regular pages 75%, and on one page 50%. However, for some reason, the height on every color section is 110% (you can see that the overlay is covering the right height as I set it)
I’ve added links to 3 sample pages for you to see the problem.I’ve cleared the browser cache several times – didn’t help
Thank you again for all the help
Reut RachelJune 28, 2024 at 10:20 pm #1460014Hi,
Thanks for the link, I only see an issue with the first one, but I don’t think there will be a solution for this, try Guenni007’s solution and see if that helps.Best regards,
MikeJune 29, 2024 at 5:41 pm #1460197Sorry, the example page from above is already for another experiment. Hover the header ;)
August 8, 2024 at 8:17 am #1464106Hi
Thank you again for all the help.
I want to make a few changes to the header, most of them are CSS changes but I could do them for some reason1. I would like to change the burger section colors
– background – #201d1e
– burger lins – #ffffff2. I’ve added a search option. For some reason, it only shows on the mobile menu. I would like it to be displayed on the desktop too
3. I would like to change the social icons color to – #304d03
4. When the menu opens, it has a large pudding on the left (the menu items are aligned to the right). I saw that there is a pudding of 50px so I changed it to 15px like the right pudding but it did not do anything
Can you please help me with those 4 things?
Thank you
August 10, 2024 at 12:27 pm #1464313Hi,
To change the burger menu background to #201d1e and the lines white: Try this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:#top .av-hamburger { line-height: 40px; background-color: #201d1e; } #top .av-burger-overlay li li .avia-bullet, #top .av-hamburger-inner,#top .av-hamburger-inner::before, #top .av-hamburger-inner::after { background-color: #fff !important; }
this is the expected results:
to change the social icons color to – #304d03, try this css:#right-toolbar .social_bookmarks a { color: #304d03; }
this is the expected results:
when the menu is open there is no padding on the left, this is the width of the menu. For a smaller menu try this css and adjust to suit:.html_av-overlay-side .av-burger-overlay-scroll { width: 200px; }
Best regards,
MikeAugust 13, 2024 at 12:14 am #1464495Hi Mike,
Thank you so much. This helped a lot.
3 things, please
1. The burger background, how can I change the whole menu container (content 1) background and not just the burger background?
I’ve added padding on the left and right and didn’t use this code=line: line-height: 40px;
but the pudding does not fit into the container no matter what I tried it either too small on the right or it’s too big on the left (I added pic no. 1 for you to see)
and when the menu is open I would like it to be all white and the – X to close to be in #8c8c8c (the color of the background) and not like what it is with the padding (I added pic no. 2)2. I’ve added a search option. It is to be shown on the menu, But it’s only on the mobile menu. I would like it to be displayed on the desktop too
3. I would like to enlarge the space between the menu and the logo (which means that the logo and the social links will be a little down)Thank you again for all the help
ReutAugust 14, 2024 at 11:30 pm #1464640Hi,
To show the search icon on the desktop menu try enabling Enfold Theme Options ▸ Main Menu ▸ General ▸ Append search icon to main menu
I can’t see your images as they require a login, to add a screenshot please try using an Screenshot service and pasting the image URL in your post.Best regards,
MikeAugust 17, 2024 at 3:02 pm #1464816Hi,
1. I’ve already enabled Append search icon to main menu as I wrote, the search icon is showing in the menu on the mobile. However, it is not showing on the desktop.
2. Regarding the burger menu:
When the menu is closed, I would like for the container background to be – #8c8c8c and the burger menu itself to be #ffffff
and when the menu is open the container background should be #ffffff and the – X should be #8c8c8c.
so I used the code you gave me and I added padding on the left and right and didn’t use this code=line: line-height: 40px;
but the pudding does not fit into the container no matter what I tried it either too small on the right or it’s too big on the left –
https://img.savvyify.com/image/Screenshot-2024-08-13-010003.9rZ05
https://img.savvyify.com/image/Screenshot-2024-08-13-005948.9rpaf3. I would like the menu links inside the burger menu to be in this color – #92B743. I’ve tried changing it in advanced styling, but nothing has changed on the desktop and mobile views.
Thank you so much for all the help
Reut
- This reply was modified 4 months ago by Rachel.
August 17, 2024 at 9:50 pm #1464837Hi,
I added this css for the search icon to show:#top #content1 .av-main-nav > li.menu-item#menu-item-search { display: block!important; } #top #content1 .av-main-nav > li.menu-item#menu-item-search a { color: #92B743; text-align: left; } #top #content1 .main_menu .menu li#menu-item-search { float:none; }
Best regards,
Mike -
AuthorPosts
- The topic ‘Changes to right sidebar header’ is closed to new replies.