Exceptional subsite without (my company) Credit footer

Hi,
I have one multisite which has the credit footer on the bottom and it appears on all of our subsites. There are some special website owners who might want to remove the credit footers from their website. I am currently using 'Branda plugin'.
Please advise me how to remove it from some of our subsites?

  • Ash
    • WordPress Hacker

    Hello iamJayChong

    Please try the following code:

    add_action( 'wp_head', function() {
    	$blog_ids = array( '12, 34, 56, 78' );
    	if( in_array( get_current_blog_id(), $blog_ids ) ) {
    		?>
    		<style>
    			.copyright-footer{
    				display: none;
    			}
    		</style>
    		<?php
    	}
    } );

    Here the following

    $blog_ids = array( '12, 34, 56, 78' );

    is an example of list of IDs where you want to hide the copyright information.

    You can use this code in your child theme's functions.php if the theme is not changed. Otherwise mu-plugin is the best option. To create a mu-plugin, go to wp-content/mu-plugins folder. If there is no mu-plugins folder then, create one. Now, inside the mu-plugins folder create file with name anything.php (make sure file extension is .php). Now start with a <?php tag and then put the above code.

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,
    Ash

  • iamJayChong
    • Flash Drive

    Hi, thank you for your reply,

    Refer to my attachment picture, I want to remove the footer "Made with Love by Jagole | Powered by J" . I created it using Branda plugin. So all my subdomain have this content footer at the moment, but I plan to remove or edit it in some of my subdomains.

    Kindly advise.

  • Kris
    • Support

    Hi iamJayChong

    If this footer was created via Branda in network then you can simply load this footer for main site only, and set up empty footer for all subsites in this multisite so they will not display this main footer. Please check below screenshot:

    If you still want ot use is for specific sites Ash solution will be the best option. However if this was made in Branda css class will need to be change to ID, so correct code will be:

    add_action( 'wp_head', function() {
    	$blog_ids = array( '12, 34, 56, 78' );
    	if( in_array( get_current_blog_id(), $blog_ids ) ) {
    		?>
    		<style>
    			#branda_content_footer{
    				display: none;
    			}
    		</style>
    		<?php
    	}
    } );

    and as Ash mentioned
    $blog_ids = array( '12, 34, 56, 78' ); are some test blog ID's which you will need to correct to those where you want to hide this footer.
    Hope this help :slight_smile:

    Kind Regards,
    Kris

  • iamJayChong
    • Flash Drive

    hi,
    First of all, thank you for your help.
    I followed the instruction based on the explanation.

    Based on attachment image, I created a new folder for mu-plugins and then create a file with php and then paste the code inside that file with.

    But this doesn’t work, the credit footer Branda still shows on at some sites that I plan to remove it. I also try it in my child theme's functions.php.

    Can you identify if I am doing something wrong, or would you have another solution to make it work?

    Many thanks for your time.
    jagole.com

  • Kris
    • Support

    Hi iamJayChong

    I see the code looks ok, but you mention later:
    I created it using Branda plugin
    In this case ca you follow this part: https://premium.wpmudev.org/forums/topic/exceptional-subsite-without-my-company-credit-footer#post-1405207
    where code is little bit different and should be ok for data from Branda footer.

    Simply replace this part

    <style>
    			.copyright-footer{
    				display: none;
    			}
    		</style>

    to

    <style>
    			#branda_content_footer{
    				display: none;
    			}
    		</style>

    Hope this help :slight_smile:

    Kind Regards,
    Kris

  • iamJayChong
    • Flash Drive

    Hi Kris,
    Thank you very much for your time!

    From my screenshot, I change the code in a mu-plugins file like the one you suggest(#branda_content_footer) but still, it doesn't work.
    I also apply that code inside the child theme's functions.php which I used Flatsome theme but not working neither.

  • Kris
    • Support

    Hi iamJayChong

    I consult this with our developers and on above codes there was some small bug. I test below code and it works perfect for many blog ID's as a mu plugin:

    <?php
    
    add_action( 'wp_head', function() {
    	$blog_ids = array( 12, 34, 56, 78 );
    	if( in_array( get_current_blog_id(), $blog_ids ) ) {
    		?>
    		<style>
    			#branda_content_footer{
    				display: none;
    			}
    		</style>
    		<?php
    	}
    } );

    The issue was this part:
    $blog_ids = array( '12, 34, 56, 78' );
    when correct one is
    $blog_ids = array( 12, 34, 56, 78 );

    Let us know does it work now :wink:

    Kind Regards,
    Kris

  • Kris
    • Support

    Hi iamJayChong

    I will need in this case your site access and ftp as well so I could take closer look on this.

    Please send it through our secure contact form here https://premium.wpmudev.org/contact/#i-have-a-different-question and make sure that subject is "I have a different question" and:
    - Mark to my attention: ATTN: Krzysztof Tomczyk
    - site access (login url / username / password)
    - FTP credentials (host / username / password / port)

    - Link back to this thread

    Please don't share any sensitive information (i.e credentials) in the Support Forum, it has public visibility and everyone will have access to it.
    Please confirm here in thread that you have sent that message.

    Kind Regards,
    Kris

  • Kris
    • Support

    Hi iamJayChong

    Thank you for access to site and to ftp. I review code and your ftp and it turns out you create mu-plugins folder in incorrect place.
    I was in /wp-content/plugins/mu-plugins.
    I correct this to /wp-content/mu-plugins and now code works ok and those sites ID does not display this footer anymore.

    Hope this help :slight_smile:

    Kind Regards,
    Kris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.