Replace search-icon with search bar in the header

Posted in: Newspaper
Post count: 6

Hi,

I was wondering: is it possible to replace the search-icon (magnifying glass) in the header with the actual search bar that pops up after clicking on that icon? I would like to have a search bar on the top right of my header always displayed (not that people have to click on the icon first)

Thanks,
Bastian

Post count: 22421

Hello,
It can be done only with customization. The theme does not have any such setting. Sorry. You can replace the search icon with a default wp search element and use a do_shortcode function https://developer.wordpress.org/reference/functions/do_shortcode/ inside the header menu file: http://screencast.com/t/L5Hcu8H5i
Thank you!

Post count: 6

Hi Bodgan,

thanks for your reply and sorry for my late response.

I located the search part in the header-menu.php. Is it possible for you to show me in your second screenshot, how I would replace the icon with the default wp search element using the do_shortcode function? I’m not familiar with coding I’m afraid, and I wouldn’t know what to do.

Also: Isn’t it also possible to simply use the code from the actual search bar from the newspaper theme somehow and replace it with the icon so we just get rid of the step “clicking the icon” ?

Thank you so much.

P.S. the website is http://www.bastian-weber.com (in case it helps)

Post count: 22421

Hello,

Unfortunately if you remove the search button and replace it with a search box, the live search will not work anymore. You can use this code:
<?php echo do_shortcode('[vc_wp_search]'); ?>
And add it like so: http://screencast.com/t/flOqdCTcZ
It will require a bit of css for further positioning though.

Thank you!

Post count: 6

Hey Bodgan,

thank you very much!! It worked!

I added some margin and padding values to the respective classes and in the desktop version it looks really good. However, as soon as I change the resolution it looks pretty weird. Is it possible to have the search bar always visible in the desktop and tablet version but change back to the search-icon in the mobile version?

Thanks!

Post count: 23312

Hello BastianWeber,

Please keep in mind that this type of task is not easy to achieve and it involves to do some additional customizations until you achieve as you wish and we cannot provide customization services at the moment, sorry! If you want to display more levels in ur theme and if you are not aware of the steps which are needed to take in this regard, please consider hiring a freelancer/developer to help you!

Thanks for your understanding!

Post count: 59

Dear Team,

Not work for me > http://screencast.com/t/zPsacEO974KS
this is code i put > http://screencast.com/t/4Dta7GtDt

help

Thanks

Post count: 59

Dear Team,

Not works,
no change, still as before

Thanks

Post count: 23312

Hello imambudianto5,

Please look at this picture and remove that white space -> http://screencast.com/t/4DY6BatvM2m

Thanks for the message!

Viewing 9 posts - 1 through 9 (of 9 total)
The forum ‘Newspaper’ is closed to new topics and replies.