- This topic has 18 replies, 2 voices, and was last updated 5 years, 12 months ago by Tom.
-
AuthorPosts
-
April 27, 2018 at 6:26 pm #562216daryl
Hi All,
forgive me, I’m a graphic designer (specialising in print) and very new to wordpress.
I’m trying to replace the menu icon to the right with the larger hamburger icon png i created which matches up with ‘a’ favicon.
I’ve mangeged to get it up on the site just to show where I want it, but the tiny little menu button still appears underneath, which provides the actual link to open the menu.
how do I get this png to replace the working menu button and working as the menu button does now, so I can discard the small menu button entirely
I would also like it to act in the same way as the ‘a’ favicon, ie get smaller at the breaking point like the favicon does. I can’t find a quick and easy way to put my hambuger png icon in like i did with the favicon, also on smaller devices I’d still like the word’menu’ to appear next to it.
Also I have a line underneath in the site header which i would like to appear on all devices just below the ‘a’ and the hamburger, and instead of going off the page would like the edges of the line to line up to the left edge of the ‘a’ circle… and the right edge of the hamburger circle. I’m probably being really stupid, but I’d also like them just to scroll down and maintain the line underneath and the logo and hamburger not to jump onto the sticky, which seems to be using a different size logos and different positions but I can’t seem to figure out and tell wordpress to use just the same header with line underneath all the way down as the page scrolls.
please help
kind regards
DarylApril 27, 2018 at 9:21 pm #562289TomLead DeveloperLead DeveloperHi there,
Try doing this to add the icon:
.slideout-toggle a:before { content: url(URL TO YOUR BIG IMAGE); }
Then this for all mobile:
.menu-toggle:before { content: url(URL TO SMALL IMAGE); width: auto; vertical-align: middle; }
For the border, do this:
.inside-header { padding-left: 0; padding-right: 0; margin-left: 40px; margin-right: 40px; }
Once you get the above working, we’ll take a look at the sticky issue π
April 28, 2018 at 6:22 am #562451darylThanks Mike,
the mobile screen now has the correct sized logo in, thanks for that..
i’m struggling with the positioning though (on the mobile menu), and the little hamburger still appears, unfortunately nothing has changed with the line underneath either after adding the code, and it docent appear on the mobile site header at all:-(
i’ve given a couple of samples below between how it looks now and the desired outcome… any help on this would be greatly appreciated
how i’d like site header to look on computer screen
https://aearyl.com/wp-content/uploads/2018/04/normal-size-menu.pnghow site header currently looks on computer
https://aearyl.com/wp-content/uploads/2018/04/Screenshot_computer-screen-as-is.pnghow i’d like site header to look on mobile screen
https://aearyl.com/wp-content/uploads/2018/04/mobile-menu.pnghow site header currently looks on mobile screen
https://aearyl.com/wp-content/uploads/2018/04/Screenshot-mobile-as-is.pngthe code is like double dutch to me but i’ll try my best, if it was print design i’d just grab it and move it ha ha π
for the line I used some of your code previously to get the line in there
.site-header {
border-bottom: 2px solid #ffffff;
}and adding the new code hasn’t done anything..
all the codes I’m adding to the customising additional css screen.
thanks again for your help
April 28, 2018 at 10:14 am #562626TomLead DeveloperLead DeveloperI’m not seeing this CSS added:
.slideout-toggle a:before { content: url(URL TO YOUR BIG IMAGE); }
Instead, I’m seeing this:
.slideout-toggle:before { content: url(URL TO YOUR BIG IMAGE); }
Try the first snippet instead.
I just adjusted the mobile snippet above, so it should work better: https://generatepress.com/forums/topic/changing-menu-hamburger-to-png/#post-562289
I’m not seeing the
.inside-header
code I provided on your site. Did you remove it?April 28, 2018 at 12:08 pm #562680darylthanks for your help Tom,
worked a treat for the hamburger icon.
for the line the code is in there but the line still goes off the edges… have I put the code in correctly?
I’d also like the line to be a lot closer to the icons (i.e. to be the same px count as the icons are from the top of page so icons appear to be vertically centred, with a smaller overall height for the site header
like this
…and then the line to appear on all devices…
and when we get that sorted, the whole site header to just scroll down as the user scrolls down
again thanks for your help with this… amazing theme π
April 28, 2018 at 9:10 pm #562875TomLead DeveloperLead DeveloperAh, try changing:
.site-header { border-bottom: 2px solid #ffffff; }
To:
.inside-header { border-bottom: 2px solid #ffffff; }
Then reduce the bottom header padding in Customize > Layout > Header.
There also seems to be some sort of issue with your BB/slider on the home page right now?
April 29, 2018 at 1:08 pm #563285darylthanks Tom, thats really worked well for the width of the line…
I tried to get the height padding down too, and added a 0 value which has pushed it up closer to the icons, but not enough it seems?, unfortunately its still not the same height as the gap at the top, which was 10 at the time .. but i’d still like to shorten the overall height of the site header so made the top gap 5 now, but the bottom gap won’t reduce any further and i’ve got it at 0, is there a work around for this please, to get it to be the same gap as the top, and thus shortening the overall height?
Also if the same line could appear on mobiles that would be great, it currently doesn’t unfortunately? .. and then after that, the whole header just to scroll down as the user goes down the page π apologies for asking too much… i’m so new to websites and coding seems like learning to read again π
btw for the BB, I was just testing a few sliders so it looks a little broken at the moment…. but going to replace it with this page for the home https://aearyl.com/about-2-3/ (am testing a few siders on this page too)
again thanks so much for your help π
April 29, 2018 at 9:14 pm #563477TomLead DeveloperLead DeveloperLet’s try this instead:
1. Set your navigation as your header: https://docs.generatepress.com/article/navigation-logo/#navigation-as-header
2. Add this CSS:
.main-navigation:not(.slideout-navigation) { margin-left: 30px; margin-right: 30px; width: auto !important; border-bottom: 1px solid #fff; }
3. Reduce your menu item height in Customize > Layout > Primary Navigation and Customize > Layout > Sticky Navigation.
That should give you the exact result you’re looking for – along with the sticky navigation π
May 1, 2018 at 4:40 am #564499darylHi Tom,
thanks for your instructions
Everything’s gone astray unfortunately.
Am i doing something wrong?if I put the hamburger on the right hand side, the menu items get shifted to almost off the screen , so have to make it left aligned so that menu items are where I need them to be, but it means the hamburger shifts over to the left which i don’t want.(i’ve attached the screenshot of the position i like the menu items in which they are now )
also the line now works on the scroll down which is good, and is the correct width (on just the scroll down) but I don’t seem to be able to control the height of site header without making the ‘a’ icon virtually disappear? so it’s the same spacing as before and I’ve completely lost the two icons lining up vertically and the positioning of the hamburger (as above).
Also, if I make the ‘a’ bigger it stays that size on mobiles too, whereas before it was working quite nicely on mobiles and everything was lining up, but we only needed to add the line and make the whole header move down on scroll.
and finally, when the page opens up, the line now appears all the way across again, it’s ok as you scroll down the screen with the correct padding, but the line goes right off the edges again when at the top off the page..
Sorry about this …I know now why I’ve shied away from web design and coding till now ha ha
any help will be greatly appreciated
screenshots attached
thanks
DarylMay 1, 2018 at 8:56 pm #565081TomLead DeveloperLead DeveloperSo what happens if you set the navigation alignment to the right?
Also, it doesn’t work setting the menu item height to something smaller (50px-is) in Customize > Layout > Primary Navigation?
May 2, 2018 at 9:46 am #565661darylHi Tom,
Here’s some screenshots to show what happens.
if i send to right the hamburger goes off the page
and the menu items are right aligned (which isn’t too bad visually on desktop, but then doesn’t look correct on the mobile)
if I make the header height smaller … the icon height disappear virtually.. shown in the grey area
and doesn’t seem to have much effect on the overall position of the line
and when i make the icons the correct height 120px it loses its nice formatting on mobiles that it had before
.. and when it’s at the top of the home page the line still goes off the edges
I would love it to look like this and just scroll down the page
and on a mobile like this and then just scroll down
Again thanks so much for your help in this…
am i doing anything wrong from what you see from the screenshots?
May 2, 2018 at 2:26 pm #565899TomLead DeveloperLead DeveloperWe’ll tackle this bit by bit, because there’s definitely some strange things happening.
New CSS – add this instead of what you have above:
.main-navigation:not(.slideout-navigation) { margin-left: 30px; margin-right: 30px; width: auto !important; border-bottom: 1px solid #fff; } .slideout-toggle a:before { content: url(URL TO YOUR LOGO); width: 100px; } .menu-toggle:before { content: url(URL TO SMALL IMAGE); width: 50px; vertical-align: middle; } #mobile-header { width: calc(100% - 60px) !important; }
Once you have your old CSS removed and this added, let me know. This should give us a step in the right direction.
Let me know π
May 2, 2018 at 4:34 pm #565982darylHi Tom,
thats great, that part has worked a treat π thank you so much
I added vertical-align: middle; to the below part of the code (the line was a bit far off so I put this on) so the line is now close to the A and the hamburger … and everything is lined up vertically, and while header is much shorter which is exactly right on desktops:-).. let m know if i’m meant to the this out though in case you were going to add more code and It’ll mess the next step?
.slideout-toggle a:before { content: url(https://aearyl.com/wp-content/uploads/2017/11/hamburger-icon.png); width: 100px; vertical-align: middle; } so the only part now to be fixed is the big 'a'... which is fine on desktop, but still says the same big size on mobiles... if theres a fix for this part too, that would be amazing ;-) and think the header would be done once this part is fixed :-) again thanks so much for your help D
May 2, 2018 at 4:36 pm #565983darylapologies for the few spelling mistakes on that.. 14 hour days here with work π
hopefully it still makes sense though
May 2, 2018 at 5:39 pm #566001TomLead DeveloperLead DeveloperGetting there!
Now, what happens if you set your menu item height to around 60px on mobile in Customize > Layout > Primary Navigation?: https://www.screencast.com/t/LwXduKvHpMF
-
AuthorPosts
- You must be logged in to reply to this topic.