December 2017
Beginner
458 pages
7h 52m
English
Lastly, we will make the search bar functional. Right now if we put something in the Search... box here and press Enter, it's not doing anything. We know the search bar should be in the header.php file, so let's open it:
<?php wp_head(); ?></head><body <?php body_class(); ?>> <header class="w3-container w3-teal"> <div class="w3-row"> <div class="w3-col m9 l9"> <h1><?php bloginfo('name'); ?></h1> </div> <div class="w3-col m3 l3"> <input class="w3-input" type="text" placeholder="Search..."> </div> </div> </header>
In the preceding code, right now we have a simple <input> tag. We will turn this input into a form, so put the <form> tags around it:
<form> <input class="w3-input" type="text" placeholder="Search..."> ...
Read now
Unlock full access