Tagged: search box
-
AuthorPosts
-
April 8, 2017 at 8:50 am #774380
Hey Everyone,
I’ve been asked by my client to move the search box up in the header and get it centered. I would like et to be ready to write in and visible. I’m assuming this isn’t too difficult, but after a couple of hours of searching and sifting through the code, I figured maybe someone else could point me in the right direction?
Here is the link to a site. Here you can how I would like my search box to be placed: http://www.sportmaster.dk
Thanks for the help as always everyone!
– DinnyApril 8, 2017 at 9:08 am #774385Hey Cykelstyrken!
That would require more work as it would require to change the position at files also.
Best case scenario is to hire someone to help you out, as it is outside of our support scope.Thank you
Cheers!
BasilisApril 8, 2017 at 9:28 am #774404@cykelstyrken take a look in /enfold/includes/helper-main-menu.php. You will find a couple of action hooks that can be used to add extra content. Some of them are dependent on the header style you have chosen in the enfold setting (e.g. menu below). First of all you need a child theme either to use the hooks in the functions.php of the child or to overload templates.
For example if one would like to have the search box above the header you would use the following function and style it via css:
add_action ( 'ava_main_header', 'mmx_header_search' ); function mmx_header_search() { echo '<div id="mmx_header_search">' . get_search_form(false) . '</div>'; }
To get the header style like in your example you could use the enfold header style ‘logo left, menu below’ and add the following code to your child themes functions.php:
add_action ( 'ava_before_bottom_main_menu', 'mmx_header_search' ); function mmx_header_search() { echo '<div id="mmx_header_search" style="display: inline-block; position: absolute; top: 2em; right: 3em;">' . get_search_form(false) . '</div>'; }
This examples should give you an idea how to accomplish this task and where to start. Have fun.
June 14, 2017 at 9:26 pm #808229hi,
my search box isn’t visible after the update as well,
before that, I put the box, directly to write, into the navigation bar, using this code in function.php:add_filter( ‘wp_nav_menu_items’, ‘avia_append_search_nav’, 10, 2 );
function avia_append_search_nav ( $items, $args )
{
if(avia_get_option(‘header_searchicon’,’header_searchicon’) != “header_searchicon”) return $items;if ((is_object($args) && $args->theme_location == ‘avia’) || (is_string($args) && $args = “fallback_menu”))
{
global $avia_config;
ob_start();
$getform = get_search_form(false);$items .= ‘<li id=”menu-item-search” class=”noMobile menu-item menu-item-search-dropdown”>’.$getform.’‘;
}
return $items;
}can you please tell me what to change, that it will appear like before ?
thanks
verenaJune 15, 2017 at 7:57 am #808424Hi,
Are you using a child theme? If not, your change may be replaced after the updates.
Best regards,
John Torvik -
AuthorPosts
- You must be logged in to reply to this topic.