[Resolved] Appending extra content alongside the navigation bar

Home Forums Support [Resolved] Appending extra content alongside the navigation bar

Home Forums Support Appending extra content alongside the navigation bar

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #126192
    Richard Bland

    Morning Tom,

    I’ve had a client query which I know I can solve with some additional coding into the header, but I wondered if there was a way of adding some content alongside the navigation bar which is currently set to float to the right at the top of the page.

    What I’d ideally like to do is to add in a couple of language flags ‘buttons’ for translation, but have them sit within or alongside the main navigation bar.

    Any ideas on this one?

    I know if I go into the header php file I can alter the grid containers and add in another container to house this content, effectively pushing the nav bar to the left a bit, but when it is responsive it will look a little odd.

    How would you go about adding in these additional buttons to the top right of the site, where the main navigation bar is currently sitting?

    #126202
    Tom
    Lead Developer
    Lead Developer

    Hi Richard,

    There’s a hook inside the navigation you can use: generate_inside_navigation

    So it would be something like:

    add_action( 'generate_inside_navigation','generate_insert_into_navigation' );
    function generate insert_into_navigation()
    { ?>
          Put your HTML or whatever in here
    <?php }

    Let me know if that works or not ๐Ÿ™‚

    #126221
    Richard Bland

    I will give it a try in a moment. I am working on the site as we speak. Cheers buddy.

    #126225
    Tom
    Lead Developer
    Lead Developer

    Cool – I’m off to bed (12:30AM). Will check back in the morning ๐Ÿ™‚

    #126227
    Richard Bland

    Is this a hook from the GP Hooks add on or do I need to put this function in somewhere else? I can’t see a GP Hook called inside navigation… ;-^

    #126343
    Tom
    Lead Developer
    Lead Developer

    That hook isn’t in GP Hooks yet, so you need to add it as a function: https://generatepress.com/knowledgebase/adding-php-functions/

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