[Support request] Site Title in Navigation Bar

Home Forums Support Site Title in Navigation Bar

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #365286
    Gary

    How can I get the site title to appear in the primary navigation bar (at the left) on every page but the home page?

    Thanks!
    Gary

    GeneratePress 1.3.48
    GP Premium 1.4.2
    #365323
    Jamal

    You can try this php

    //Site title inside navigation
    add_action( 'generate_inside_navigation','site_title_inside_navigation' );
    function site_title_inside_navigation() { 
      if ( !is_front_page() ){?>
        <div class="inside-navigation-content">
            <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a>
        </div>
    	<?php }
      }

    Then add this css

    .inside-navigation-content {
        display: inline-block;
        float: left;
        padding-top: 10px;
    }

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

    Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.

    #365326
    Leo
    Staff
    Customer Support
    #365332
    Jamal

    Happy to help out Leo. I had this ready in my GeneratePress gist so i copy pasted it here.

    Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.

    #365436
    Gary

    I copied both pieces of code provided into ‘Code Snippets’ and ‘Simple CSS’.
    I do not see the site title in the menu.
    On pages other than the front page, the last menu item wraps onto the next line (which I do not want to happen).

    I have removed it from my site for now as its not working.

    Was I supposed to modify any of the code to meet my specific site?

    Thanks!
    Gary

    #365469
    Leo
    Staff
    Customer Support

    The first block of code goes into Code Snippet and url need to be replaced with the actual site url.

    The second block og code goes into Simple CSS and nothing needs to be modified there.

    If this doesn’t work can you link me to the site?

    Thanks!

    #606410
    Paul

    I want to add the site-description to the navigation along with the site-title too. What should this code look like in order to do that? Thanks in advance.

    #606412
    David
    Staff
    Customer Support

    Hi Paul, something like this:

    add_action( 'generate_inside_navigation','site_title_inside_navigation' );
    function site_title_inside_navigation() { ?>
        <div class="inside-navigation-content">
            <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a>
            <p title="<?php bloginfo('description'); ?>"><?php bloginfo('description'); ?></a>
            </div>
    <?php }
    #606415
    Paul

    Cheers, thanks David!

    #607874
    David
    Staff
    Customer Support
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.