I’m trying to show WordPress search box into my website where i am trying to show an icon in the search box
<?php get_search_form(); ?>
HTML Form
<form role="search" method="get" class="header-search-form" action="<?php echo home_url( '/' ); ?>">
<label>
<input type="search" class="search-field" placeholder="SEARCH" value="<?php echo get_search_query(); ?>" name="s" title="Search for:" /> <i class="fa fa-search"></i>
</label>
</form>
And This CSS
/* Style the search form */
.header-search-form {
display: flex;
justify-content: center; /* Center the search bar in the header */
align-items: center;
margin: 0 auto;
padding: 5px;
}
.header-search-form input[type="search"] {
border: 2px solid #bf2137; /* Border color */
border-radius: 20px; /* Rounded corners */
padding: 10px 15px;
color: #bf2137; /* Text color */
font-size: 16px;
}
.header-search-form input[type="search"]::placeholder {
color: #bf2137; /* Placeholder text color */
}
.header-search-form input[type="submit"] {
display: none; /* Hide the default search button */
}
Everything is perfect fine except the fact that the () fa-fa icon is not showing in the box.
I am basically looking to show fa fa search icon with in the search box.
New contributor
Mehdi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.