badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Editing footer in child them functions.php

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #40302
    Greyhare
    Participant

    When I originally developed the website http://www.pollysperennials.co.uk/ the forum gave me code to put in my child theme function.php to change the footer info. This had worked since but having done some upgrades it is now not working. This is what I have:

    <?php

    // Remove old copyright text
    add_action( ‘init’ , ‘mh_remove_copy’ , 15 );
    function mh_remove_copy() {
    remove_action( ‘attitude_footer’, ‘attitude_footer_info’, 30 );
    }

    // Add my own copyright text
    add_action( ‘attitude_footer’ , ‘mh_footer_info’ , 30 );
    function mh_footer_info() {
    $output = ‘<div class=”copyright”>’.’Copyright © [the-year] [site-link]   |   Website by: Greyhare Design ‘.'</div><!– .copyright –>’;
    echo do_shortcode( $output );
    }

    I did try to edit but ended up with Parse Error and had to restore original function.php via ftp.
    The theme is Attitude free 1.8 and I wish to update that as well but am concerned that things may go wrong. Can I revert to original version from a backup if there are problems?

    #40434

    Hi Greyhare,

    According to WordPress guidelines add_shortcode() has been removed. So we have changed that code according to WordPress guidelines. So the above code will work. It needs code customization.

    Please remove this code
    $output = ‘<div class=”copyright”>’.’Copyright © [the-year] [site-link] | Website by: Greyhare Design ‘.'</div><!– .copyright –>’;

    and add this code
    $output = ‘<div class=”copyright”>’.__( ‘Copyright ©’, ‘attitude’ ).’ ‘.attitude_the_year().’ ‘ .attitude_site_link().’ | ‘ . ‘ ‘.__( ‘Website by: Greyhare’, ‘attitude’ ).'</div><!– .copyright –>’;
    echo $output;

    Thank you!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.