Edit search box position and output results
-
I have added a searchbox to my nav menu, but would like it to always appear aligned on the right hand side. I would also like it to output the search results as it appears in the blog (i.e. Post title, photo, continue reading link). Can anyone help?
I currently have this in my child theme functions.php file:
function menu_search($items){ $search = '<li class="search">'; $search .= '<form method="get" id="searchform" action="/">'; $search .= '<label for="s" class="assistive-text">Search</label>'; $search .= '<input type="text" class="field" name="s" id="s" placeholder="Search" />'; $search .= '<input type="submit" class="submit" name="submit" id="searchsubmit" value="Search" />'; $search .= '</form>'; $search .= '</li>'; return $items . $search; } add_filter('wp_nav_menu_items','menu_search');
My site is: https://lovemebluphotography.com/
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Edit search box position and output results’ is closed to new replies.