[Resolved] Place html or widgets inside sticky menu nav bar?

Home Forums Support [Resolved] Place html or widgets inside sticky menu nav bar?

Home Forums Support Place html or widgets inside sticky menu nav bar?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #134179
    Are Martin

    Hi Tom, I would like to put an adsense custom search box inside the sticky menu instead of the built in search function. I currently use a html text widget to to this elsewhere on my site.

    I would like the search box to appear somewhere in the middle of the nav bar between the menu items and the logo, alternatively just right next to the logo. Could this be achieved in a relatively easy way?

    Kind Regards

    Are Martin Kallaak

    #134210
    Tom
    Lead Developer
    Lead Developer

    You’re probably better off disabling the navigation search and hooking your HTML into the navigation like this:

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

    You’ll have to put your search code in a div with a class so you can target it with CSS to position it, but this should get you started 🙂

    Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

    #134850
    Are Martin

    Thanks! That´s perfect! 🙂

    #134853
    Tom
    Lead Developer
    Lead Developer

    No problem! 🙂

    #135012
    Are Martin

    Hmm.. I was a bit too fast there…. Nothing shows up in the nav bar when I put in the code above. :/

    #135166
    Tom
    Lead Developer
    Lead Developer

    Can you link me to your site? 🙂

    #135223
    Are Martin

    Here you go: http://www.fysionett.no

    I´ve used a plugin called code snippets to add the code you supplied above and pasted in the code for the search box.

    I gave it a class called “sok” , which means search in my language. However I haven’t positioned it with css yet. But still nothing shows up anywhere…

    #135321
    Tom
    Lead Developer
    Lead Developer

    Ah, I made a mistake in the code snippet above.

    Re-paste it and you should be good to go 🙂

    #135398
    Are Martin

    It´s working now. Thank you! 🙂

    #135463
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

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