Custom footer

Hi Aigars

Would you be able to assist me with creating a custom footer for the site I’m creating?

I would like the footer to have the copyright, year, site title, theme by Colorlib, but then to say designed by me with a link to my own website, rather than have the Wordpress link.

I found this, but it results in just my credit being displayed:

<?php

// Replace copyright information from footer-extensions.php

// Remove old copyright text
add_action( 'init' , 'remove_copyright' , 15 );
function remove_copyright() {
        remove_action( 'travelify_footer', 'travelify_footer_info', 30 );
}

// Add new copyright info
add_action( 'travelify_footer' , 'new_footer_info' , 30 );
function new_footer_info() {
   $output = '<div class="copyright">Your new copyright information</div>';
   echo $output;
}

?>

Thanks indeed.

This code should be added to Child Theme functions.php to take effect.

// Remove old copyright text
add_action( 'init' , 'remove_copyright' , 15 );
function remove_copyright() {
        remove_action( 'travelify_footer', 'travelify_footer_info', 30 );
}

// Add new copyright info
add_action( 'travelify_footer' , 'new_footer_info' , 30 );
function new_footer_info() {
   $output = '<div class="copyright">Copyright &copy; 2014 Website Name. Theme by <a href="https://colorlib.com/wp/" target="_blank" title="Colorlib" >Colorlib</a> Designed by <a href="http://example.com" target="_blank" title="Website Title">Website Name</a> </div>';
   echo $output;
}

I added all necessary things on your new copyright information and you can modify it accordingly

Thank you Aigars, that definitely helps. I’m pleased to say I was almost there myself, so getting the hang of this php thingy!

Is there a way of displaying the current year? If not, I’ll just aim to remember to update the code in January!

You can get it done like this:

// Remove old copyright text
add_action( 'init' , 'remove_copyright' , 15 );
function remove_copyright() {
        remove_action( 'travelify_footer', 'travelify_footer_info', 30 );
}

// Add new copyright info
add_action( 'travelify_footer' , 'new_footer_info' , 30 );
function new_footer_info() {
   $output = '<div class="copyright">Copyright &copy; [the-year] Website Name. Theme by <a href="https://colorlib.com/wp/" target="_blank" title="Colorlib" >Colorlib</a> Designed by <a href="http://example.com" target="_blank" title="Website Title">Website Name</a> </div>';
   echo do_shortcode( $output );
}

The only change here is that I added [the-year] shortcode and created echo do_shortcode( $output );

Now year will be updated automatically based on your hosting date.

Perfect, Thank you Aigars!