- This topic has 11 replies, 2 voices, and was last updated 5 years, 6 months ago by Tom.
-
AuthorPosts
-
October 15, 2018 at 10:33 am #701527Eva
Hey Tom,
I am back again with another question π
My client would like to see the primary navigation full width with a visible search field, like this: https://www.xanderuitgevers.nl/I think I have managed to get the primary nav full width. Can you please tell me if it’s possible to adjust the search field? I have added the link in the field below.
Thanks!
EvaPS. I need to make the logo full width too, but maybe I should open a new topic for that?
October 15, 2018 at 3:47 pm #701742TomLead DeveloperLead DeveloperHi there,
You can add a search field to the navigation by adding a new “Hook” element in “Appearance > Elements”.
In the hook content field, add this:
<?php get_search_form(); ?>
In the hook settings, set it to the
inside_navigation
hook, and execute PHP: http://prntscr.com/l6i2nwThen add this CSS:
.inside-navigation .search-form { float: right; line-height: 60px; /* height of your navigation */ }
Let me know if you need more info π
October 16, 2018 at 8:12 am #702322EvaHi Tom,
Yes, it works :-)!! I tried to work a bit more on the looks, but I can’t get done what I want….
– The word ‘zoeken’ (search) appears two times: in the search field and again right from the search field. How can I get rid of the second one? Or is it possible to change it to a looking glass, as at https://www.xanderuitgevers.nl.
– How can I reduce the padding of the search field?
– Is it possible to line the text in the search field with the menu items?
– I would like to hide the search form on mobile, because it doesn’t look nice there…Sorry for so many questions…
Thanks again,
EvaOctober 16, 2018 at 6:44 pm #702700TomLead DeveloperLead DeveloperAny chance you can link me to what it is right now? I can’t find your GP site within the link you shared in your private field.
October 17, 2018 at 2:56 pm #703640EvaI am sorry Tom, the link had expired but now it’s active again. Hope you will have time to take another look.
Thank you!!October 17, 2018 at 7:27 pm #703744TomLead DeveloperLead DeveloperThat link is taking me to a page with 4 book covers. Each book cover takes me to the site you used as an example – not the GP site.
Let me know π
October 18, 2018 at 8:41 am #704270EvaThat’s weird, because I send it to my client and it worked… I activated the link again, and I will send it to you via the contact page. Hope that works out π
Sorry!!
EvaOctober 18, 2018 at 10:01 am #704355TomLead DeveloperLead DeveloperNo worries! Have you already sent the details? I’m not seeing them.
Let me know π
October 18, 2018 at 2:48 pm #704624EvaSorry Tom, Iwas out. Just send you the link. Hope it works.
October 18, 2018 at 7:02 pm #704690TomLead DeveloperLead DeveloperSo to change the search submit to a search icon, you’d need to replace:
<?php get_search_form(); ?>
With this:
<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>"> <label> <span class="screen-reader-text">Search for:</span> <input type="search" class="search-field" placeholder="Search..." value="<?php echo get_search_query(); ?>" name="s" /> </label> <input type="submit" class="search-submit" value="" /> </form>
Then add this CSS:
.main-navigation .search-submit { font-family: GeneratePress; }
Then for your other questions, try this CSS:
.main-navigation input[type=search] { padding: 5px 10px; } .main-navigation .search-form { position: relative; top: -10px; } @media (max-width: 768px) { .main-navigation .search-form { display: none; } }
October 19, 2018 at 4:56 am #704972EvaThank you so much Tom! It works fine now.
Best theme, best support!!October 19, 2018 at 11:51 am #705343TomLead DeveloperLead DeveloperGlad I could help π
-
AuthorPosts
- You must be logged in to reply to this topic.