Business People Club

How to add top menu to wordpress theme with search box?

0 like 0 dislike
237 views
in Articles by HarmlessRose
How to add top menu to wordpress theme with search box?

Your comment

Your name to display :
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Comment

0 like 0 dislike
commented by BouncyOracle
Step-1 add to functions.php

function st_topmenu() {
 echo '<div id="topbar">';
 echo '<div class="container">';
 wp_nav_menu( array( 'container_class' => 'menu-header', 'depth' => '1', 'theme_location' => 'topmenu', 'menu_id' => 'topmenu'));
 echo '<form role="search" method="get" id="searchform" action="'.home_url( '/' ).'">';
 echo '<div><label class="screen-reader-text" for="s">Search for:</label>';
 echo '<input type="text" value="" name="s" id="s" />';
 echo '<input type="submit" id="searchsubmit" value="Search" />';
 echo '</div>';
 echo '</form>';
 echo '</div><!--/.container-->';
 echo '<div class="clear"></div>';
 echo '</div><!--/#topbar-->';
}
add_action('st_above_header','st_topmenu', 1);
register_nav_menus( array('topmenu' => __( 'Top Navigation', 'smpl' )));

Step -2 add to css

/* Top Navigation */
  
/* container element */
#topbar {
 width: 100%;
 background-color: #d5d5d5;
 margin: 0;
 border-bottom: 1px solid #f4f4f4;
}

#topbar .container {
 margin: 0 auto;
 width: 940px;
}

/* Search Form */
#topbar #searchform {
 float: right;
 margin: 5px 0 0 0;
}
 
/* link styles */
#topbar li a {
 color: #4a81d3;
 text-decoration: none;
 border-right: 1px solid #eaeaea;
 padding: 10px;
 display: block;
}
#topbar .menu-header {
 border-left: 1px solid #f4f4f4;
}
 
#topbar li a:hover {
 color: #333;
 background-color: #e5e5e5;
}
 
/* list reset */
#topbar ul,#topbar li {
 margin: 0;
 padding: 0;
 list-style: none;
}
#topbar li {
 float: left;
 line-height: 100%;
}

Step -3 add this snippt to header.php

Lastly, edit header.php and add this line:

<?php do_action('st_above_header');?>

Just before:

<div id="wrapper">

Related posts

0 like 0 dislike
0 comments 76 views
How to add navigation menu to wordpress site?

In this short video, you will learn how to add navigation menu to wordpress site

in Tutorials by List
0 like 0 dislike
0 comments 99 views
How to add dropdown menu to your wordpress site

In This Video you will learn how to add dropdown menu to your wordpress site. If you have any questions, reply to this lesson to get answers.

in Tutorials by List
0 like 0 dislike
0 comments 144 views
How to create a website menu in wordpress?

In this lesson, you will learn how to create a website menu.

in Tutorials by List
0 like 0 dislike
0 comments 92 views
How to change wordpress theme?

In this lessson, you will learn how to change wordpress website theme.

in Tutorials by List
0 like 0 dislike
1 Comment 316 views
How to get best wordpress theme for my website?

I am looking for best free wordpress theme for my website?

in Articles by VirtualAssassin
0 like 0 dislike
0 comments 2,149 views
Custom Menu in WordPress

Learn about custom menu in wordpress.

in Tutorials by List
0 like 0 dislike
0 comments 99 views
How to add new features to your wordpress website?

In this lesson, you will learn how to add new features to your wordpress site.

in Tutorials by List
0 like 0 dislike
0 comments 558 views
How to add article categories to your wordpress site?

In this lesson, you will learn how to add article categories to your wordpress site.

in Tutorials by List
0 like 0 dislike
0 comments 296 views
Working with fonts in wordpress

Learn how to work with fonts in wordpress

in Tutorials by List
0 like 0 dislike
0 comments 2,123 views
How to insert audio into wordpress post

Learn how to add audio into wordpress.

in Tutorials by List
0 like 0 dislike
0 comments 2,132 views
0 like 0 dislike
0 comments 388 views
How to insert youtube videos into wordpress post ?

learn how to add youtube videos into wordpress post.

in Tutorials by List
0 like 0 dislike
0 comments 227 views
How to password protect wordpress pages

In this video you will learn how to password protect wordpress pages.

in Tutorials by List
0 like 0 dislike
0 comments 142 views
How to password protect wordpress post

In this video you would learn how to to password protect your wordpress post.

in Tutorials by List
0 like 0 dislike
0 comments 79 views
How to upload media file to wordpress website?

In this lesson you will learn how to upload media files.

in Tutorials by List
0 like 0 dislike
0 comments 228 views
How to password protect wordpress site?

In this lesson you will learn how to password protect wordpress site.

in Tutorials by List
0 like 0 dislike
0 comments 94 views
How to manage comments in wordpress?

In this lesson you will learn how to manage comments in wordpress.

in Tutorials by List
0 like 0 dislike
0 comments 184 views
How to disable comments in wordpress site?

In this lesson you will learn how to disable comments in wordpress.

in Tutorials by List
0 like 0 dislike
0 comments 78 views
How to set timezone in your wordpress site?

In this lesson, you will learn how to set time zone in your wordpress site.

in Tutorials by List
0 like 0 dislike
0 comments 2,282 views
How to install wordpress in few minutes?

In this lesson you will learn how to install wordpress in few minutes.

in Tutorials by List
0 like 0 dislike
0 comments 79 views
How to publish articles on wordpress site?

In this lesson, you will learn how to publish articles.

in Tutorials by List
0 like 0 dislike
0 comments 75 views
How to manage wordpress media library?

In this lesson, you will learn how to manage wordpress media library.

in Tutorials by List
0 like 0 dislike
0 comments 88 views
How to backup and restore wordpress site?

In this short video, you will learn how to back up and restore wordpress site using softaculous.

in Tutorials by List
0 like 0 dislike
0 comments 234 views
How to change font size on my wordpress website?

How to change font size on my wordpress website? What would be the code and Where do i need to add it?

in Articles by BunBunny
0 like 0 dislike
0 comments 282 views
How to install wordpress plugins?

If i have wordpress plugin in zip file, how can i install it on my wordpress site?

in Articles by KeyboardPie
0 like 0 dislike
0 comments 281 views
how to download wordpress themes for free?

I want free wordpress themes? Where to download them?

in Articles by GardenParrot
0 like 0 dislike
1 Comment 314 views
How to change font size in wordpress website?

I want to change font size in my wordpress website?

in Articles by Octopuppy
0 like 0 dislike
1 Comment 398 views
How to install multisite wordpress?

How to install multisite wordpress?

in Articles by Herogue
0 like 0 dislike
1 Comment 265 views
How to change font size in wordpress site?

How to change font size in wordpress site?

in Articles by Richard S.
0 like 0 dislike
1 Comment 306 views
How to install wordpress?

How to install wordpress site ?

in Articles by FoolishJaguar
0 like 0 dislike
1 Comment 236 views
How to change post background in wordpress?

I want to change post background in my wordpress site?

in Articles by GiftedWrecker
0 like 0 dislike
1 Comment 276 views
How to download wordpress plugins free?

Where can I download free wordpress plugins?

in Articles by GroundHurricane
0 like 0 dislike
1 Comment 599 views
How to download wordpress themes for free?

Is there any way I could download wordpress themes for free? Any tips?

in Articles by SwiftHeroine
0 like 0 dislike
0 comments 2,176 views
Links in Wordpress posts

Learn about links in wordpress posts.

in Tutorials by List
0 like 0 dislike
0 comments 2,136 views
WordPress Post

Learn about wordpress post.

in Tutorials by List
0 like 0 dislike
0 comments 2,141 views
Pages and Posts in WordPress

Learn about posts and pages in wordpress.

in Tutorials by List
0 like 0 dislike
0 comments 2,133 views
WordPress Settings

Learn about wordpress settings.

in Tutorials by List
0 like 0 dislike
0 comments 2,129 views
WordPress Admin Toolbar

Learn about wordpress admin toolbar.

in Tutorials by List
0 like 0 dislike
0 comments 2,140 views
WordPress Dashboard

Learn about wordpress dashboard.

in Tutorials by List
0 like 0 dislike
0 comments 2,144 views
Logging into wordpress

Learn how to log into wordpress.

in Tutorials by List
0 like 0 dislike
0 comments 2,126 views
WordPress Uses

Learn about wordpress users.

in Tutorials by List
0 like 0 dislike
0 comments 2,137 views
Comments in Wordpress

Learn about comments in wordpress.

in Tutorials by List
0 like 0 dislike
0 comments 2,137 views
Installing Wordpress themes

Learn about installing wordpress themes.

in Tutorials by List
0 like 0 dislike
0 comments 2,136 views
Customizing Appearance in Wordpress

Learn how to customize website appearance in wordpress.

in Tutorials by List
0 like 0 dislike
0 comments 2,126 views
WordPress Themes

Learn about wordpress themes.

in Tutorials by List
Connect with us:
...