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
    • Code Norris

    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
    • Technology Simplicity

    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 Tomczyk
    • Ex Staff

    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:

    [attachments are only viewable by logged-in members]

    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
    • Technology Simplicity

    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 Tomczyk
    • Ex Staff

    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://vvpmudev.com/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
    • Technology Simplicity

    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 Tomczyk
    • Ex Staff

    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 Tomczyk
    • Ex Staff

    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://vvpmudev.com/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 Tomczyk
    • Ex Staff

    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

  • Kris Tomczyk
    • Ex Staff

    Hi again.

    I double-checked our last email conversation about the site access and FTP. It looks like those data do not work anymore. Which is reasonable and I’m glad you deleted or changed those accounts for security reason.

    Could you follow my guide once again from here:
    https://vvpmudev.com/forums/topic/exceptional-subsite-without-my-company-credit-footer/#post-3657172
    and send again site and FTP access so I could take a closer look at this?

    Kind Regards,
    Kris

  • Kris Tomczyk
    • Ex Staff

    Hi :slight_smile:

    Thank you for all the data. I was able to replicate this issue for site ID 143. I also tested this code once again on my lab site, and it still works correctly.

    I could find only one difference between the rest of the subsites. Site ID 143 is a mapped domain and this could be the issue here. I made a quick test in this mu-plugin by adding:
    var_dump( get_current_blog_id() ); to check does site returns it own ID. And it does.
    Even CSS from mu-plugin is in the site source.
    When I compared footer on all those sites, it looks like on the mapped domain “branda_content_footer” div does not exist at all, and your custom footer text exists only in the paragraph.

    I escalated this for our SLS Team so that they can dig into this issue further for you. We will post an update here as soon as more information is available.

    Kind Regards,
    Kris

  • Tho Bui
    • SLS

    Hello iamJayChong ,

    As I checked, the main reason is this subsite is using theme Newspaper but this theme is not using footer tag so Branda Footer content module does not work for this theme. And I see you added the custom footer content on the theme’s options.
    In this case, I fixed this by adding a DIV tag with id branda_content_footer to wrap the footer text:
    https://monosnap.com/file/6kPMSa1jyIAkUCvdqA4y9GPO7MGJAz

    Kind Regards,
    Tho Bui