- This topic has 11 replies, 2 voices, and was last updated 4 years, 2 months ago by David.
-
AuthorPosts
-
January 26, 2020 at 2:11 am #1144379Azman
I want to have the header similar to – https://www.verywellfit.com/ten-steps-to-a-healthy-new-year-2507105
Burger menu -> Logo -> Post/Page Title -> Social Profiles
Basically, I want to replicate the header of verywellfit.com
Please help!!
TIA
-AzmanJanuary 26, 2020 at 6:34 am #1144530DavidStaffCustomer SupportHi there,
It’s quite complicated to do that – maybe able to get somewhere close but will take some code.
Can you share a link to your current site, so i can see what you have so far?
You can edit your original topic and use the Site URL field to share the link privately.January 26, 2020 at 8:01 am #1144774AzmanThank you David for the prompt response.
I have edited the topic and included my website, please do have a look.
January 27, 2020 at 5:55 am #1145534DavidStaffCustomer SupportThis:
1. Install the GP Social Share plugin:
https://wordpress.org/plugins/gp-social-share-svg/2. Enable the Off Canvas Panel and assign a Menu to it.
https://docs.generatepress.com/article/off-canvas-panel-overview/3. Create another Menu without any menu items in this and assign it to the Primary Navigation.
4. Now we need to create 2 x Hook Elements:
https://docs.generatepress.com/article/hooks-element-overview/Hook 1 – Social Share
Add the Social Share shortcode:[gp-social]
Select theinside_navigation
hook
Check enable Shortcodes
Set Display Rules to Entire siteHook 2 – Post Title:
Add this content:
<span class="nav-entry-title" itemprop="headline"><?php the_title() ?></span>
Select theinside_navigation
hook
Check enable PHP
Set Display Rules to Entire siteOnce thats done let me know so i can take a look at the CSS required to make it look right.
January 28, 2020 at 1:35 am #1146569AzmanDavid, done that.
And please hide the post title for mobile devices.
Please check.
January 28, 2020 at 4:23 am #1146741DavidStaffCustomer SupportTry this CSS:
.main-navigation .main-nav, .main-navigation.has-branding .menu-toggle { order: -3 !important; } .main-navigation .navigation-branding { order: -2; margin-right: unset; } .nav-entry-title { order: -1; } .main-navigation #gp-social-share { margin-left: auto; margin-right: 20px; }
To hide title on mobile edit this HTML and include the
hide-on-mobile
class<span class="nav-entry-title hide-on-mobile" itemprop="headline"><?php the_title() ?></span>
January 28, 2020 at 6:59 am #1147084AzmanLooking much better now.
But,
1. the navigation is splitting into two rows in mobile and tablet view.
2. the logo is getting too small on mobile.
3. Need a vertical line of around 2px between logo and post title distinct them.
4. And how can a style the post title with CSS?
January 28, 2020 at 7:19 am #1147113DavidStaffCustomer Support1. Add this CSS:
@media (max-width: 768px) { #primary-menu { flex-basis: 0 } }
2. in Customizer > Layout > Primary Navigation – increase the Mobile Menu Item height.
3. Edit this CSS to include the padding and border properties:
.nav-entry-title { order: -1; padding-left: 10px; border-left: 2px solid #000; }
4. same as point 3
January 28, 2020 at 10:57 am #1147406AzmanDavid, we are almost there.
I just wanted to ask can we replicate the same as [verywellfit.com], where the post title comes on the navigation bar only on the scroll.
January 28, 2020 at 11:03 am #1147412DavidStaffCustomer SupportCan you enable Customizer > Layout > Sticky Navigation – then i can take a look.
January 29, 2020 at 9:03 am #1148393AzmanDone that.
January 29, 2020 at 9:11 am #1148413DavidStaffCustomer SupportAdd this CSS:
.main-navigation:not(.navigation-stick) .nav-entry-title { display: none; }
-
AuthorPosts
- You must be logged in to reply to this topic.