Conversation
supportI know this is covered in the FAQ but I appoligize for being a complete n00b. Where does the below code go? add_filter( ‘bop_nav_search_screen_reader_text’, function( $text, $item, $depth, $args ){ $text = ”; //for nothing $text = __( ‘<span class=”screen-reader-text”>The text you want</span>’, ‘myslug’ ); //to change – the __() is for theme translation return $text; }, 10, 4 ); I added it to my functions.php file and got a major error and had to delete the code.
Hi and_e30, functions.php is the right place. Your issue comes on the line: $text = ”; //for nothing You have used a double quotation mark rather than two single quotation marks (i.e., " rather than '' ). That said, you may as well simply delete this line as it does nothing of worth; it is simply there to demonstrate that the old $text value was being overwritten. Hope this helps. Cheers, Joe P.S., it’s also worth noting that myslug should be changed to your theme’s text domain – usually the same name as the theme’s folder.
This worked great, thank you so much. however now I have a new issue. the search box is aligning high in my menu bar when viewed on the desktop (the mobile version runs fine as the format changes. Is there a way to vertical align the box so it is inline with the other menu buttons? my website is http://www.bimmertips.com
li.bop-nav-search { padding: 20px 0; }
unfortunately that did not work adding it to my functions.php file. It gave me an error and could not view the website at all.
Hi, It’s css. It’s meant to go in style.css at the bottom. Cheers, Joe
Thanks for the clarification Joe, it seemed to have work on Chrome but not on Safari.
Hi, I’m afraid that’s something you’re going to have to play around with to work out. I don’t have any apple products and therefore can’t test safari (also styling changes are beyond the remit of this plugin and are naturally going to be custom from theme to theme and site to site). Cheers, Joe P.S., It’s also perfectly understandable to leave safari with aesthetic issues as it has low market share and is truly the worst browser around by a massive margin.
Hi and_e30, functions.php is the right place. Your issue comes on the line: $text = ”; //for nothing You have used a double quotation mark rather than two single quotation marks (i.e., " rather than '' ). That said, you may as well simply delete this line as it does nothing of worth; it is simply there to demonstrate that the old $text value was being overwritten. Hope this helps. Cheers, Joe P.S., it’s also worth noting that myslug should be changed to your theme’s text domain – usually the same name as the theme’s folder.
This worked great, thank you so much. however now I have a new issue. the search box is aligning high in my menu bar when viewed on the desktop (the mobile version runs fine as the format changes. Is there a way to vertical align the box so it is inline with the other menu buttons? my website is http://www.bimmertips.com
li.bop-nav-search { padding: 20px 0; }
unfortunately that did not work adding it to my functions.php file. It gave me an error and could not view the website at all.
Hi, It’s css. It’s meant to go in style.css at the bottom. Cheers, Joe
Thanks for the clarification Joe, it seemed to have work on Chrome but not on Safari.
Hi, I’m afraid that’s something you’re going to have to play around with to work out. I don’t have any apple products and therefore can’t test safari (also styling changes are beyond the remit of this plugin and are naturally going to be custom from theme to theme and site to site). Cheers, Joe P.S., It’s also perfectly understandable to leave safari with aesthetic issues as it has low market share and is truly the worst browser around by a massive margin.