BuddyBoss Home – Web › Support Forums › Themes › BuddyBoss theme › Banner in the header of pages (not in homepage)
- This topic has 11 replies, 2 contibutors, and was last updated 9 years, 1 months ago by Anonymous.
Question
October 6, 2015 at 3:17 pm #48079@sashanetHi guys,
how could I insert a banner in the header of pages (excluding homepage)? I try to insert the banner code through WP Bannerize but in Buddyboss theme it is not allowed to insert a widget (including the banner code) in the header.
Could you help me?
Many thanks
Sashanet
Answers
October 9, 2015 at 5:44 am #48290@
AnonymousHey @sashanet you can use conditional logic like
https://codex.wordpress.org/Function_Reference/is_home<?php if ( !is_home() ) { if(function_exists( 'wp_bannerize' )) { wp_bannerize(); } } ?>
Regards
Varun DubeyOctober 9, 2015 at 5:45 am #48291@
AnonymousYou will need to modify codes inside the child theme header.php
RegardsOctober 9, 2015 at 6:25 pm #48346@sashanetThank you Varun!
October 10, 2015 at 1:14 pm #48404@sashanetHi Varun,
I solve the trouble by inserting the banner code directly in the header.php of the child theme but now I have another issue: when the webisite is in mobile version and you click the menu (in the top right), the menu is in background and it is overridden by the banner.
How can I do in order to show the complete menu? I would like that when user click the menu (in the mobile version), it is shown the menu above the banner. Is it possible?
Thank you in advance,
Sashanet
October 11, 2015 at 1:18 am #48434@
AnonymousHi @sashanet , Please provide us the site link to inspect the banner and suggest corresponding css
RegardsOctober 11, 2015 at 7:32 am #48453@sashanetOctober 13, 2015 at 1:06 am #48586@
AnonymousHi @sashanet
#main #eadv_pos_1_868ad50cb6bc1959b2725b436cfc4a32 { max-width: 100%; }
or you may apply it as the width is applied on div with id ‘eadv_pos_1_868ad50cb6bc1959b2725b436cfc4a32 ‘
A fixed width is given to the div that is causing it to occupy that area in mobile view.
Regards
Varun DubeyOctober 15, 2015 at 4:01 pm #48798@sashanetHi @vapvarun, sorry but this way is not the best solution for my website.
Instead, if I would like to hide the banner (only this one) when the website is in mobile view, how can I do it?
Thank you very much
Sashanet
October 16, 2015 at 12:56 pm #48868@
AnonymousHi @sashanet
You can use
<?php if ( wp_is_mobile() ) { } ?>
https://codex.wordpress.org/Function_Reference/wp_is_mobile
Regards
Varun DubeyOctober 18, 2015 at 6:43 am #49018@sashanetOK, but in what file should I insert this code?
I try to put it into “Buddyboss-child/header.php” (where is located my banner’s code) but whether I do this, the website doesn’t work 🙁
Thank you very much
Sashanet
October 19, 2015 at 1:08 pm #49121@
AnonymousHi @sashanet
Sorry of unclear instruction , you can both the conditions like this, and in that way banner will be display if it is not home and only at desktop
wp_is_mobile is inbuilt conditional logic of WordPress.<?php if ( !is_home() && !wp_is_mobile() ) { if(function_exists( 'wp_bannerize' )) { wp_bannerize(); } } ?>
Regards
Varun Dubey
- The question ‘Banner in the header of pages (not in homepage)’ is closed to new replies.