- This topic has 9 replies, 2 voices, and was last updated 5 years, 5 months ago by
Tom.
-
AuthorPosts
-
September 3, 2015 at 4:50 pm #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
September 4, 2015 at 12:39 am #134210Tom
Lead DeveloperLead DeveloperYou’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/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 6, 2015 at 3:09 pm #134850Are Martin
Thanks! Thatยดs perfect! ๐
September 6, 2015 at 3:40 pm #134853Tom
Lead DeveloperLead DeveloperNo problem! ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 7, 2015 at 8:43 am #135012Are Martin
Hmm.. I was a bit too fast there…. Nothing shows up in the nav bar when I put in the code above. :/
September 7, 2015 at 7:13 pm #135166Tom
Lead DeveloperLead DeveloperCan you link me to your site? ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 8, 2015 at 5:49 am #135223Are 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…
September 8, 2015 at 9:32 am #135321Tom
Lead DeveloperLead DeveloperAh, I made a mistake in the code snippet above.
Re-paste it and you should be good to go ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 8, 2015 at 3:26 pm #135398Are Martin
Itยดs working now. Thank you! ๐
September 9, 2015 at 12:49 am #135463Tom
Lead DeveloperLead DeveloperYou’re welcome ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.