Use php to align search box in nav?
-
So Ive succesfully added a search bar into my navigation menu using:
add_filter('wp_nav_menu_items','add_search_box', 10, 2); function add_search_box($items, $args) { ob_start(); get_search_form(); $searchform = ob_get_contents(); ob_end_clean(); $items .= '<li>' . $searchform . '</li>'; return $items; }
and now I’m wondering if I have to use CSS to right align and put some padding on or can I put some more into the php? and code and help would be greatly appreciated!
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Use php to align search box in nav?’ is closed to new replies.