[Support request] Slideout menu and topbar or text next to slideout menu

Home Forums Support [Support request] Slideout menu and topbar or text next to slideout menu

Home Forums Support Slideout menu and topbar or text next to slideout menu

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #847091
    Saqib

    Hi, using gneeratepress with spacious. Still getting used to the theme.

    Im trying to create some text either next to the slideout menu button, or the slideout menu button on the same line as the top bar. (that way I can have text on the top bar)

    #847557
    Tom
    Lead Developer
    Lead Developer

    Since the entire top bar is the main navigation, there isn’t a super easy way to do this.

    You could try a function like this:

    add_filter( 'wp_nav_menu_items', function( $nav, $args ) {
        if ( $args->theme_location == 'primary' ) {
            $text = 'Your custom text here.';
    
            return $nav . '<li class="custom-text"><a href="#">' . $text . '</a></li>';
        }
    
        return $nav;
    }, 20, 2 );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Let me know 🙂

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