Site logo

Archived topic

searchbar only on desktop

11 replies · Started by Philippe on May 12, 2022

Viewing posts 1–12 of 12

Hi,
I want to add searchbar on header after website logo and just before social logos (right on header)

But only on home and only on desktop

how can i do it?

Many thanks
Phil

Here is the website : https://comment-stocker.fr

Hi
I have paste this html code to its content (the content is html only), but not works :
<!-- wp:search {"label":"Rechercher","showLabel":false,"placeholder":"Rechercher…","buttonText":"Rechercher","buttonUseIcon":true} /-->

think i don't have made the right thing
what can i do more please ?

Thks
Phil

OK if you're using the classic editor then.

1. DELETE the hook you created.

2. Create a New Hook Element:

https://docs.generatepress.com/article/hooks-element-overview/

3. In the text area add:

<?php get_search_form(); ?>

4. Set the Hook to: generate_after_logo

5. Check the Execute PHP option.

6. Set the Display Rules > Location to: Front Page

Hi

Thanks for your response, but no way, it don't works too.

Also, i don't understand your sentence "OK if you’re using the classic editor then.", i don't have another choice, on the hook editor there is only this choice ! (i use gutenberg on all the website, without classic editor plugin).
Do i have a bug on my installation ?

Just for finish my entire demand, i wan't also that the search bar is only displayed on desktop.

Many thanks,
Phil

yes but where i can use the element block gutenberg, on the hook editor there is no place to choose it and the hook element editor can accept only code ?

… And the search bar don't appear too, have you the solution on my problem?

don't works too

Can you describe how didn't it work?

No sorry all it's ok now many thanks
best regards
Phil

Very glad to hear that :)

This archived topic is closed to new replies.