April 17, 2012

PHP – Footer function sample

Question by NewLearner

I’ve been looking all over but I cannot find an example. I want to write a foother function into my functions.php Can you please give me a simple sample of how this is done. I think I have an idea but I’m not sure if will work.

 function footer_function()
 {
   $return_Str='';
   $return_Str .= '<h3>Copyright © 2012</h>';
   return $return_Str;
}

Thank you all for your help!!!

Answer by Starx

This is probably what you wanted.

function footer() {
    $return_str = "";
    $return_str .= '<h3>Copyright 2012</h3>';
    return $return_str;
}

To display the footer. Just do this

echo footer();

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!