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

PowerShell: Working With Arrays

Problem: elements of a System.Array couldn't be counted # Example output when an object is…

PowerShell: Perform DISM Restore Health on Remote Servers

# This script will use a Windows ISO image to Repair Remote Computers$isoPath="\\FILESHERVER007\F$\Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO"$remoteComputers="TESTKOMPUTER","TESTKOMPUTER2"function restoreServerHealth($iso){ #…

How to Install Secured Shell SSH on Windows

# Windows 10 & Server 2019 # Install the OpenSSH Server Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0…