• I’m creating a custom search form but can’t figure out how to get results from category + keyword, the results just list all posts within the category, ignoring the keyword field.

    <form role="search" action="<?php echo site_url('/'); ?>" method="get">
    
            <input type="search" name="s" placeholder="Search: Enter artwork keywords hit enter"/>
    
    		<?php
    		// generate list of categories
    		$categories = get_categories();
    		echo '<select name="category_name">';
    		echo '<option value="">Tudo</option>';
    		foreach ($categories as $category) {
    			echo '<option value="', $category->slug, '">', $category->name, "</option>\n";
    		}
    		echo '</select>';
    		?>
    
            <input type="submit" alt="Search" value="Search" />
    
        </form>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to search category keyword?’ is closed to new replies.