BuddyBoss Home – Web Support Forums Themes BuddyBoss theme Banner in the header of pages (not in homepage)

Viewing 12 posts - 1 through 12 (of 12 total)
  • Question

    #48079
    @sashanet

    Hi 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

    #48290

    Anonymous
    @

    Hey @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 Dubey

    #48291

    Anonymous
    @

    You will need to modify codes inside the child theme header.php
    Regards

    #48346
    @sashanet

    Thank you Varun!

    #48404
    @sashanet

    Hi 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

    #48434

    Anonymous
    @

    Hi @sashanet , Please provide us the site link to inspect the banner and suggest corresponding css
    Regards

    #48453
    @sashanet

    http://www.mybizmeet.com

    Thank you

    Sashanet

    #48586

    Anonymous
    @

    Hi @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 Dubey

    #48798
    @sashanet

    Hi @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

    #48868

    Anonymous
    @

    Hi @sashanet

    You can use

    
    <?php
    if ( wp_is_mobile() ) {
    	
    }
    ?>
    

    https://codex.wordpress.org/Function_Reference/wp_is_mobile
    Regards
    Varun Dubey

    #49018
    @sashanet

    OK, 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

    #49121

    Anonymous
    @

    Hi @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

Viewing 12 posts - 1 through 12 (of 12 total)
  • The question ‘Banner in the header of pages (not in homepage)’ is closed to new replies.