Search Bar
-
Hi,
I want to remove the search bar from my front-page.
Don’t mind it being on the other pages.
How do you actually remove it from just that one page ?
Thanks for your help.
-
Am awaiting how it’s done!
Am awaiting how it’s done!
Just take it out of your home.php? Or build an if statement around it.
if(!bp_is_front_page()) {
// show search form
}Edit: See that the standard theme doesn’t have a home.php, my bad. Script should work either way (only now in header.php).
Just take it out of your home.php? Or build an if statement around it.
if(!bp_is_front_page()) {
// show search form
}Edit: See that the standard theme doesn’t have a home.php, my bad. Script should work either way (only now in header.php).
This works for me.
This works for me.
edit/ hmm far too slow
Use a conditional template tag
For reference they are found here:
https://codex.buddypress.org/developer-docs/conditional-template-tags/
You will want something like:
bp_is_front_page()
Wrap the div#search-bar in an:
<?php if(!bp_is_front_page()): ?>
<div id="search-bar">
</div><!-- #search-bar -->
<?php endif; ?>Something like that anyway.
Am awaiting how it’s done!
Surely Gpo1 you had an inkling how to do this hadn’t you?
edit/ hmm far too slow
Use a conditional template tag
For reference they are found here:
https://codex.buddypress.org/developer-docs/conditional-template-tags/
You will want something like:
bp_is_front_page()
Wrap the div#search-bar in an:
<?php if(!bp_is_front_page()): ?>
<div id="search-bar">
</div><!-- #search-bar -->
<?php endif; ?>Something like that anyway.
Am awaiting how it’s done!
Surely Gpo1 you had an inkling how to do this hadn’t you?
Is it home.php or header.php to look for that script?
Is it home.php or header.php to look for that script?
Have a look through the files it will only take a second
Have a look through the files it will only take a second
Thanks…Sorted
Thanks…Sorted
- The topic ‘Search Bar’ is closed to new replies.