• Resolved marmarr

    (@marmarr)


    I have searched the forums on how to change the footer credit to just the year and my site name. I came up with having to create a child theme and entering code into it. I have done that and the code looks like this

    /*
     Theme Name:   attitude child theme
     Theme URI:    http://example.com/twenty-fourteen-child/
     Description:  attitude
     Author:       John Doe
     Author URI:   http://example.com
     Template:     attitude
     Version:      1.0.0
     Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
     Text Domain:  attitude
    */
    
    <?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]  '.'</div><!-- .copyright -->';
       echo do_shortcode( $output );
    }
    @import url("../attitude/style.css");
    
    /* =Theme customization starts here
    -------------------------------------------------------------- */

    It is not working. I activated the child theme and it changed my settings bac to default attitude theme but the footer is the same. What am I doing wrong?

    Thanks a lot in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey there.

    When you activate the child theme, it is its own theme that’s why you see the default.

    This part:

    /*
     Theme Name:   attitude child theme
     Theme URI:    http://example.com/twenty-fourteen-child/
     Description:  attitude
     Author:       John Doe
     Author URI:   http://example.com
     Template:     attitude
     Version:      1.0.0
     Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
     Text Domain:  attitude
    */

    Goes into a css file.

    But the next part you have is PHP:

    <?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]  '.'</div><!-- .copyright -->';
       echo do_shortcode( $output );
    }

    That’s PHP, well that goes into a PHP file.

    You can create a functions.php file in the child and include it there. That said, if it’s just a little copyright it might be just as efficient to edit the footer.php in the child theme.

    This bit remains in the CSS file:

    @import url("../attitude/style.css");
    
    /* =Theme customization starts here
    -------------------------------------------------------------- */

    Take care.

    Thread Starter marmarr

    (@marmarr)

    Thanks a lot Timothy!

    I went and created two files and it now works after having edited them for a bit.

    Awesome!

    Glad I could help, have a great weekend! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove footer credit’ is closed to new replies.