Theme Support Forum
Support Forum for Free and Premium Themes. Premium Theme Forums are Private! Please log in first to see the Premium forums
-
#12452
On June 14, 2012 at 8:04 pm
Hi,
i am using Cylla Pro and i would like to put my search box into my main menu.
Did anybody has an idea how this works?
Regards
Roman
#17394
On June 15, 2012 at 7:35 am
Go to Appearance> Editor and select “functions.php” and add these lines:
function add_search_to_wp_menu ( $items, $args ) {
if( 'primary' === $args -> theme_location ) {
$items .= '<li class="menu-item menu-item-search">';
$items .= '<form method="get" class="menu-search-form" action="' . get_bloginfo('home') . '/"><p><input class="text_input" type="text" value="Enter Text & Click to Search" name="s" id="s" onfocus="if (this.value == 'Enter Text & Click to Search') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Enter Text & Click to Search';}" /><input type="submit" class="my-wp-search" id="searchsubmit" value="search" /></p></form>';
$items .= '</li>';
}
return $items;
}
add_filter('wp_nav_menu_items','add_search_to_wp_menu',10,2);
before this line:
//Post Thumbnail
#17395
On June 15, 2012 at 8:20 pm
I added this lines (at the end of the list), but i did`nt worked 🙁
Hello! this is Towfiq, a passionate web developer from Bangladesh, building website templates for almost 4 years and sharing them with the world. Most of my designing/ programming skills are self taught. Providing free Wordpress themes to wordpress enthusiasts is another one of my passions.
When I am not building templates, I listen to music, read books, paint and travel.
x