Multisite - display different footer

Hi Colorlib team,

First of all, thank you for the great theme and for your help on this forum, many answers have been useful to me!

I have one issue left with my website set up: I have a multisite network (using Multilingual press), and would like to display a different footer (including links) for each language.

As already answered here, I created a child theme to personalise the footer.php file (I will include credits elsewhere).

I created footer files for the other sites of my network: footer-es.php and footer-fr.php, and added the following code to the page.php file:

<?php
if ( is_page(‘2’) ) {
get_footer( ‘es’ );
if ( is_page(‘3’) ) {
get_footer( ‘fr’ );
} else {
get_footer();
}
?>

(1, 2 and 3 being the ID of my sites).

But this doesn’t work, the default footer still shows on all sites.

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

Many thanks for your time.

Tourispain.com

Hi,

I’d like to separate my posts with a bow like this. Is this possibile ?

Hi Tourispain,

I hope you are well today and thank you for your question.

You are using wrong is_page function in your shared code. The is_page function checks if the query is for one of the pages specified. You should instead use get_current_blog_id function as following.


<?php

$blog_id = get_current_blog_id();

if ( $blog_id == 2 ) {
	get_footer( 'es' );
} else if ( $blog_id == 3 ) {
	get_footer( 'fr' );
} else {
	get_footer();
}
?>

Best Regards,
Movin

@glorianocera To help us keep support thread separates could you please create your own thread for your question here https://colorlibsupport.com/c/activello/ instead of replying on others thread as it makes the thread messy and hard to read.

If you want to you can also add reference of this thread in your newly created thread.

We would be more than happy to help you on your new thread.

Hi Movin,

Thank you very much for your answer.

I tried the code you gave but it doesn’t seem to work.

Would you have another solution?

Best regards,

TouriSpain.com

Please try using below custom code instead and let me know whether it displays any text in the footer.

<?php

$blog_id = get_current_blog_id();

if ( $blog_id == 2 ) {
	echo "This is blog 2";
	get_footer( 'es' );
} else if ( $blog_id == 3 ) {
	echo "This is blog 3";
	get_footer( 'fr' );
} else {
	echo "This is blog ".$blog_id;
	get_footer();
}
?>

Hi Movin,

Thank you very much for your time!

Not working neither :frowning:

Then you must be using the shared code incorrectly.

If you are not a developer then you can consider hiring a developer to develop it for you. You can hire a developer from any freelance site. Colorlib recommends the developer https://www.upwork.com/freelancers/~011652ffec8865c6d5