Posted On July 29, 2021

WordPress: Add Search Box Into Header

kimconnect 0 comments
blog.KimConnect.com >> Codes >> WordPress: Add Search Box Into Header

Navigate to Appearance > Theme Editor > select header.php > search for this section:

					<div id="site-header-menu" class="site-header-menu">
						<?php if ( has_nav_menu( 'primary' ) ) : ?>
							<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'twentysixteen' ); ?>">
								<?php
									wp_nav_menu(
										array(
											'theme_location' => 'primary',
											'menu_class' => 'primary-menu',
										)
									);
								?>
							</nav><!-- .main-navigation -->

Insert this:

						<div class="header-search">
							<?php get_search_form(); ?>
						</div>

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

How To Modify a Windows Service

Here's the freebie code: # Version 0.02 $serviceName='Windows_Exporter' $newExePath=$false $newSwitches=" --log.format logger:eventlog?name=$serviceName --collectors.enabled os,cpu,cs,logical_disk,net,tcp,service,textfile" function…

How to Obtain Mac Address of Remote Computer

# PowerShell $computername='TESTSERVER' Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration -Filter "IPEnabled='True'" -ComputerName $computername|Select-Object -Property MACAddress, Description # Sample…

GPO Logon Banner

Update: this information is outdated. Use this link for the current method of creating Logon…