- This topic has 13 replies, 3 voices, and was last updated 5 years, 11 months ago by David.
-
AuthorPosts
-
May 20, 2018 at 4:44 pm #580383Andy
Hi,
I searched the forum and found a solution for adding a close link within the slide-out navigation.
However, I’m trying to add the new default GP close icon to the link but not had any success yet.Below is what I’ve tried so far:
add_action( 'generate_inside_slideout_navigation', 'tu_add_slideout_close' ); function tu_add_slideout_close() { ?> <li class="slider-exit"><a href="#"><i class="gp-icon close"><!-- icon --></i></a></li> <?php }
May 20, 2018 at 8:06 pm #580422LeoStaffCustomer SupportHi there,
Can you try adding this CSS?
.gp-icon.close::before { content: "\f00d"; } .gp-icon { font-family: 'GeneratePress' !important; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-size: 40px; margin: 0 10px; color: #000; }
Let me know 🙂
May 21, 2018 at 10:32 am #580964AndyWorks perfectly thanks. I thought that CSS was already part of GP so wouldn’t need re-adding.
Just a couple of other things. How do I remove the existing ‘X’ that’s outside of the nav and also how can I center the new X and menu items within that slide-out area?.
Thanks again.
May 21, 2018 at 10:49 am #580990DavidStaffCustomer SupportHi Andy, you can remove the original exit button like so:
.slideout-overlay .slideout-exit { display: none; }
Do you want the entire navigation centered? Or just the contents?
May 21, 2018 at 10:56 am #580998AndyThank you excellent, just the contents I think really.
May 21, 2018 at 11:11 am #581002DavidStaffCustomer SupportHi Andy, if you’re using the slideout everywhere ie. no horizontal nav then you can set the alignment by the customiser > layout > primary nav > navigation alignment – or this CSS:
.main-navigation.slideout-navigation { text-align: center !important; }
May 21, 2018 at 11:24 am #581015AndyThanks David,
Almost there, I’m only using the Slide-Out Nav on mobile. The CSS centers the text links but not the new close X toggle that I mentioned at the start of the thread.
May 21, 2018 at 11:33 am #581024LeoStaffCustomer SupportCan you link us to the site in question?
May 21, 2018 at 11:34 am #581027DavidStaffCustomer SupportHi Andy, try this as well:
.slideout-navigation .inside-navigation .slider-exit { float: none; }
May 21, 2018 at 11:46 am #581044AndyThanks David that fixed it, i also added list-style-type: none; to remove the unwanted bullet point from it.
I’ve decided it would look best if I increased the width of the whole slide-out to 100% width so its all centered in the viewport. I tried the following CSS but this caused it to remain open.
.offside { width: 100%; }
May 22, 2018 at 4:47 am #581555AndySo just to clarify I would like the entire slideout navigation centered.
May 22, 2018 at 5:01 am #581563DavidStaffCustomer SupportHi Andy,
target the
.offside.is-open
May 22, 2018 at 11:29 am #581966AndyPerfect thanks!
May 22, 2018 at 12:15 pm #582013DavidStaffCustomer SupportGlad we could help!
-
AuthorPosts
- You must be logged in to reply to this topic.