Community Forums › Forums › Archived Forums › Design Tips and Tricks › SEARCH BOX
Tagged: search box, secondary nav bar
- This topic has 7 replies, 3 voices, and was last updated 10 years, 8 months ago by
ShariLee.
-
AuthorPosts
-
May 14, 2015 at 8:39 pm #152281
ShariLee
MemberI am using OutreachPro, and I have a primary and secondary nav bar. I would like to put the search box at the far right
on the secondary nav bar--from which I have now deleted everything else. I have gone into the menu and tried to add it, but nothing happens. Can anyone help me with this please? Thanks. ShariLee
http://www.theglutenalarm.comShariLee Beynon
GoldaVere IMSMay 14, 2015 at 8:46 pm #152282Doug
ParticipantLike this http://www.uacnet.org
May 16, 2015 at 8:55 pm #152455Brad Dalton
ParticipantMay 18, 2015 at 9:59 pm #152655ShariLee
MemberI have tried and tried to figure this out. I put the code you suggested above into my CSS code area, but nothing happens. I think it still requires css styling, at which I am lousy! http://www.theglutenalarm.com I wanted the search box to be
right on the secondary nav bar. I still need help.
ShariLee Beynon
GoldaVere IMSMay 18, 2015 at 10:23 pm #152659Brad Dalton
ParticipantThe code is PHP code and should be added to the end of your child themes functions.php file using a code editor like Notepad++ for Windows or Text Wrangler for Mac.
Another option is to use File Manager in cPanel.
Please remove any PHP code from your style.css file or any other area designed for CSS only.
If you still require assistance, i can do the work for you.
May 18, 2015 at 11:20 pm #152672ShariLee
MemberI actually just tried that, and nothing happened... the only difference is I added it to the beginning of the child themes functions.php file. I'll go back in and move it to the bottom and see if that helps.
ShariLee Beynon
GoldaVere IMSMay 18, 2015 at 11:22 pm #152673Brad Dalton
ParticipantMay 18, 2015 at 11:27 pm #152675ShariLee
MemberWell, I went in to the theme function php file and pasted it at the bottom. I entered:
add_filter( 'wp_nav_menu_items', 'theme_menu_extras', 10, 2 );
/**
* Filter menu items, appending either a search form or today's date.
*
* @param string $menu HTML string of list items.
* @param stdClass $args Menu arguments.
*
* @return string Amended HTML string of list items.
*/
function theme_menu_extras( $menu, $args ) {//* Change 'primary' to 'secondary' to add extras to the secondary navigation menu
if ( 'primary' !== $args->theme_location )
return $menu;//* Uncomment this block to add a search form to the navigation menu
/*
ob_start();
get_search_form();
$search = ob_get_clean();
$menu .= '<li class="right search">' . $search . '';
*///* Uncomment this block to add the date to the navigation menu
/*
$menu .= '<li class="right date">' . date_i18n( get_option( 'date_format' ) ) . '';
*/return $menu;
}
I guess I'm too tired to fight with this anymore. Thank you for trying to help me. I'll go at it again tomorrow.
ShariLee Beynon
GoldaVere IMS -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.