- This topic has 12 replies, 2 voices, and was last updated 4 years, 10 months ago by David.
-
AuthorPosts
-
June 20, 2019 at 6:53 am #935906Janet Davis
Hello and thank you!
I have navigation search enabled on the man navigation.
I would like to add some copy: Such as search our site next to the magnifying glass.
Is there a way I can do this?Thank you
JanJune 20, 2019 at 7:01 am #935911DavidStaffCustomer SupportHi there,
it requires a little PHP snippet provided here:
https://docs.generatepress.com/article/generate_navigation_search_output/#add-a-placeholder
June 20, 2019 at 8:08 am #936010Janet DavisThank you
I added the following into the snippet plugin.
Two issues: I wanted to add the copy next to the magnifying glass on the menu bar before clicking on it, and the words “Enter your search” once you click on the magnifying glass are cut in half. Too high.
Janadd_filter( ‘generate_navigation_search_output’, function() {
printf(
‘<form method=”get” class=”search-form navigation-search” action=”%1$s”>
<input type=”search” placeholder=”Enter your search” class=”search-field” value=”%2$s” name=”s” title=”%3$s” />
</form>’,
esc_url( home_url( ‘/’ ) ),
esc_attr( get_search_query() ),
esc_attr_x( ‘Search’, ‘label’, ‘generatepress’ )
);
} );June 20, 2019 at 8:22 am #936028DavidStaffCustomer SupportSo try this CSS to fix the placeholder text being cut off:
input::placeholder { line-height: 1; color: #000000; }
Then this CSS to add some content before the search icon:
.main-navigation li.search-item { display: inline-flex !important; align-items: center; } .main-navigation li.search-item:before { content: 'Search'; margin-right: 10px; }
June 20, 2019 at 8:28 am #936048Janet DavisThank you almost there.
No matter how small I make the width between the menu and there is plenty of space, the search is always on the second line.June 20, 2019 at 8:32 am #936055DavidStaffCustomer SupportOops my bad – just correct the second CSS rule here
June 20, 2019 at 1:54 pm #936323Janet DavisDavid Thank You Again. It worked.
As I fix one thing I see something else sorry.When the magnifying glass is clicked on the words Enter your search fit (Yes!)
Where do I find the color for this section? I looked under navigation but didn’t’ see anything that would change the font color. The font color isn’t readable.Thank you again!
JanJune 20, 2019 at 2:06 pm #936329DavidStaffCustomer SupportGreat to hear that.
Changing the colours of the navigation requires some CSS. This topic covers that:https://generatepress.com/forums/topic/change-text-color-at-search-box/#post-884044
June 20, 2019 at 2:17 pm #936334Janet DavisThis changed the text box, but not the font.
I was able to change the box to several different colors but not the font itself.
ThanksJune 20, 2019 at 2:21 pm #936338Janet DavisTo clarify the above.
The color of the font that I type in to search is fine.
Its the color of the words Enter your search from the clicking on the magnifying glass that isn’t changing color. Thank youJune 20, 2019 at 2:24 pm #936343DavidStaffCustomer SupportThat CSS will change the color of the search text. If you want to change the placeholder text then I have edited the CSS here:
June 20, 2019 at 2:34 pm #936346Janet DavisDavid,
Thank you and I apologize.
I was not thinking that one was the pace holder and one was the navigation.Thank you for all your help!
Support is why I love GP – Well and the great GP system
JanJune 20, 2019 at 3:57 pm #936378DavidStaffCustomer SupportNo apologies necessary – glad to be of help.
-
AuthorPosts
- You must be logged in to reply to this topic.