Archived topic
Would like to display menu name below the menu bar in "Abstract" site library
11 replies · Started by Jung on January 21, 2021
Above screenshot is what I created in Adobe XD, hoping I would be able to display the menu title below the menu section. I am using a site library "Abstract". I would like to know the method of displaying the menu title like that.
Thank you.
Above screenshot is what I created in Adobe XD, hoping I would be able to display the menu title below the menu section. I am using a site library “Abstract”. I would like to know the method of displaying the menu title like that.
I'm not exactly sure fully understand the structure on the screenshot.
Is "Menu" a menu-item link or is it a simple menu toggle button label? Do you want to replace the hamburger icon which just the "Menu"? Let us know.
As you can see, the default "Abstract" site library theme does not display menu-item link name (in this case, home) on the header section by default so I am wondering if there is a way to show each menu-item link name. An example of the site library would be "Article", which displays all the menu-link names (except home).
And sorry for the confusion there, I am the one who replaced the hamburger icon with "Menu" Please disregard that part. I am just looking for a way to show the menu-item link name.
And sorry for the confusion there, I am the one who replaced the hamburger icon with “Menu” Please disregard that part. I am just looking for a way to show the menu-item link name.
To clarify further: Are you pertaining to the page-hero part of Article as marked here?
https://share.getcloudapp.com/v1u4dzje
If so, that's added using a Header Element.
More about Header Element here:
https://docs.generatepress.com/article/header-element-overview/
It's using the template tag {{post.title}} within it's code area to display the page's title (menu-item link name) to dynamically display the title/name of the page. :)
Thank you. I tried {{post_title}} and it worked. Except the "Latest Work" page displays as "Blog". Any way to change this into custom title?
Hi there,
Try this:
add_filter( 'generate_page_hero_post_title', function( $title ) {
if ( is_home() ) {
return 'Your custom title';
}
return $title;
} );
Thank you! Appreciated :)
No problem :)
I am having this same issue. My blog page is called "News Racers Can Use" and that is how it appears on the menu but the hero image says "blog."
https://staging-motorsportprospects.kinsta.cloud/blog/
Where would I put this code?
Hi Mark,
The code Tom provided is a PHP snippet.
Here's how you can run PHP snippets on your site - https://docs.generatepress.com/article/adding-php/
That worked perfectly for me. I use Code Snippets to add PHP code.
Thanks!
Nice one. Glad you go it sorted. Thanks for letting us know. :D