FaceBook in Footer
-
Hello.
I am looking to now add a facebook link into the footer.
For example, click here to like us on Facebook.What would be the best way of accomplishing this?
Thanks
Paul
-
This is the code fb gave me.
<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fallserveniagara&width&layout=standard&action=like&show_faces=false&share=true&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:35px;" allowTransparency="true"></iframe>I just have no idea where to put it.
Hi there 🙂
First go to the wordpress dash board.
And go to the widget area and put the ‘text widget’ on the footer widget area.
If you make it done, insert the code and then ckeck it on your operated web site.
Thanks.
That seems to work, but its not centered.
Do you know the iframe code that I need to make it centered?
Thanks
PaulI tried this in the iframe code, but it’s not working
<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fallserveniagara&width&layout=button&action=like&show_faces=false&share=true&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:35px;" allowTransparency="true";align="center"></iframe>functions.php
<?php // facebook code start add_filter( 'raindrops_footer_text', 'function_name' ); function function_name( $return_value ) { $html_before = '<p style="text-align:center">hello world</p>'; $html_after = '<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fallserveniagara&width&layout=button&action=like&show_faces=false&share=true&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:35px;" allowTransparency="true";align="center"></iframe>'; return $html_before . $return_value . $html_after; } // facebook code end ?><?php /** * functions and constants for Raindrops theme * * * @package Raindrops * @since Raindrops 0.1 */ if ( !defined( 'ABSPATH' ) ) { exit; }result below
http://www.tenman.info/wp3/manualraindrops/files/footer-example.gif
It works until I add the content from the existing function.php file
Old file was:
<?php add_filter( 'raindrops_footer_text', 'function_name' ); function function_name( $return_value ) { $return_value = ''; $html_before = '<p style="text-align:center;color:red;">©2014 ALL-Serve Niagara</p>'; return $html_before . $return_value ; }So I merged the two and made this:
<?php // facebook code start add_filter( 'raindrops_footer_text', 'function_name' ); function function_name( $return_value ) { $html_before = '<p style="text-align:center">hello world</p>'; $html_after = '<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fallserveniagara&width&layout=button&action=like&show_faces=false&share=true&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:35px;" allowTransparency="true";align="center"></iframe>'; return $html_before . $return_value . $html_after; } // facebook code end ?><?php /** * functions and constants for Raindrops theme * * * @package Raindrops * @since Raindrops 0.1 */ if ( !defined( 'ABSPATH' ) ) { exit; } add_filter( 'raindrops_footer_text', 'function_name' ); function function_name( $return_value ) { $return_value = ''; $html_before = '<p style="text-align:center;color:red;">©2014 ALL-Serve Niagara</p>'; return $html_before . $return_value ; }But then I get an error:
Fatal error: Cannot redeclare function_name() (previously declared in /home/content/p3pnexwpnas04_data02/42/2342542/html/wp-content/themes/raindrops-child/functions.php:5) in /home/content/p3pnexwpnas04_data02/42/2342542/html/wp-content/themes/raindrops-child/functions.php on line 31
Each code on its own works fine, put them together, and somewhere I am messing it up.
Thanks for all you assistance so far.
Paulif ( !defined( 'ABSPATH' ) ) { exit; } //remove start add_filter( 'raindrops_footer_text', 'function_name' ); function function_name( $return_value ) { $return_value = ''; $html_before = '<p style="text-align:center;color:red;">©2014 ALL-Serve Niagara</p>'; return $html_before . $return_value ; } //remove endYou should learn the basics of PHP
I am very slowly,
Thanks for your patiencePaul
SO, I merged the code into the functions.php
Receive an error:Fatal error: Cannot redeclare function_name() (previously declared in /home/content/p3pnexwpnas04_data02/42/2342542/html/wp-content/themes/raindrops-child/functions.php:5) in /home/content/p3pnexwpnas04_data02/42/2342542/html/wp-content/themes/raindrops-child/functions.php on line 33
Can I just add a “1” to the end of the function name?
Heres my new functions.php:
<?php // facebook code start add_filter( 'raindrops_footer_text', 'function_name' ); function function_name( $return_value ) { $html_before = '<p style="text-align:center">hello world</p>'; $html_after = '<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fallserveniagara&width&layout=button&action=like&show_faces=false&share=true&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:35px;" allowTransparency="true";align="center"></iframe>'; return $html_before . $return_value . $html_after; } // facebook code end ?><?php /** * functions and constants for Raindrops theme * * * @package Raindrops * @since Raindrops 0.1 */ if ( !defined( 'ABSPATH' ) ) { exit; } //remove start add_filter( 'raindrops_footer_text', 'function_name' ); function function_name( $return_value ) { $return_value = ''; $html_before = '<p style="text-align:center;color:red;">©2014 ALL-Serve Niagara</p>'; return $html_before . $return_value ; } //remove endMany thanks
PaulOk ,nobita.
Did some studying.
I was able to trim the code to this:<?php add_filter( 'raindrops_footer_text', 'function_name' ); function function_name( $return_value ) { $return_value = ''; $html_before = '<p style="text-align:center;color:red;">©2014 ALL-Serve Niagara</p>'; $html_after = '<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fallserveniagara&width&layout=button&action=like&show_faces=false&share=true&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:35px;" allowTransparency="true";align="center"></iframe>'; return $html_before . $return_value . $html_after; } ?>And it all seems fine, however, if you look at the footer:
allserveniagara.caYou will see the FB iframe is not centered?
Any ideas how to adjust that?
Paul
Never mind, it a FB developer site setting.
Thanks for all your help
The topic ‘FaceBook in Footer’ is closed to new replies.
