[Resolved] Would like to display menu name below the menu bar in “Abstract” site library

Home Forums Support [Resolved] Would like to display menu name below the menu bar in “Abstract” site library

Home Forums Support Would like to display menu name below the menu bar in “Abstract” site library

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1628738
    Jun

    screenshot

    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.

    #1628749
    Elvin
    Staff
    Customer Support

    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.

    A wise man once said:
    "Have you cleared your cache?"

    #1628800
    Jun

    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.

    #1628851
    Elvin
    Staff
    Customer Support

    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. 🙂

    A wise man once said:
    "Have you cleared your cache?"

    #1630526
    Jun

    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?

    #1630639
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Try this:

    add_filter( 'generate_page_hero_post_title', function( $title ) {
        if ( is_home() ) {
            return 'Your custom title';
        }
    
        return $title;
    } );
    #1630746
    Jun

    Thank you! Appreciated 🙂

    #1631640
    Tom
    Lead Developer
    Lead Developer
    #2100831
    Mark

    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?

    #2100869
    Elvin
    Staff
    Customer Support

    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/

    A wise man once said:
    "Have you cleared your cache?"

    #2103004
    Mark

    That worked perfectly for me. I use Code Snippets to add PHP code.

    Thanks!

    #2103373
    Elvin
    Staff
    Customer Support

    Nice one. Glad you go it sorted. Thanks for letting us know. 😀

    A wise man once said:
    "Have you cleared your cache?"

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.