WordPress.org

Ready to get started?Download WordPress

Forums

[closed] Clean Retina -Theme Horse footer (16 posts)

  1. saritlotem
    Member
    Posted 1 year ago #

    For the heck of it, I can't find where to change the Copyright on the footer. Please help.
    Thanks
    http://www.bdinelliforhair.com/

  2. That's a neat theme and very organized. But changing the copyright properly requires a little coding.

    First create a child theme for Clean Retina. Put the child theme's style.css file in themes/clean-retina-child.

    /*
    Theme Name: Clean Retina Child Theme
    Author: Self-Help WordPress User
    Template: clean-retina
    */
    
    @import url("../clean-retina/style.css");

    The footer for that theme is added via this action in the parent theme:

    add_action( 'cleanretina_footer', 'cleanretina_footer_info', 25 );

    You want to remove that action and add your own instead. To do that in your child theme directory create a blank functions.php file and add these lines to it.

    <?php
    
    // Remove old copyright text
    add_action( 'init' , 'mh_remove_copy' );
    function mh_remove_copy() {
    	remove_action( 'cleanretina_footer' , 'cleanretina_footer_info ', 25 );
    }
    
    // Add my own copyright text
    add_action( 'cleanretina_footer' , 'mh_footer_info' , 25 );
    function mh_footer_info() {
       $output = '<div class="copyright">'.'Copyright &copy; [the-year] [site-link] Powered by: SUPER MARTIANS FROM MARS! '.'</div><!-- .copyright -->';
       echo do_shortcode( $output );
    }

    Which on your installation should produce something like

    Copyright © 2012 B .Dinelli for Hair Powered by: SUPER MARTIANS FROM MARS!

    You can read about adding and removing actions in child themes at this site.

    http://themeshaper.com/2009/05/25/action-hooks-wordpress-child-themes/

    Hope that helps.

  3. saritlotem
    Member
    Posted 1 year ago #

    Thank you!
    Sorry but is there a way to do this without the child theme? I'm not sure i can do this ..

  4. If it were a simple theme then you could just edit a copy of the footer.php file. But it's not so some coding is needed. Or you can switch to a different less complex theme. ;)

    You can always create a plugin to do the exact same thing. Put this clean-retina-footer.php in your wp-content/plugins directory.

    <?php
    /*
    Plugin Name: Change Clean Retina Footer
    Description: Change the footer on the Clean Retina Theme
    Version: 0.1
    */
    
    // Remove old copyright text
    add_action( 'init' , 'mh_remove_copy' );
    function mh_remove_copy() {
    	remove_action( 'cleanretina_footer', 'cleanretina_footer_info', 25 );
    }
    
    // Add my own copyright text
    add_action( 'cleanretina_footer', 'mh_footer_info', 25 );
    function mh_footer_info() {
    	$output = '<div class="copyright">'.'Copyright &copy; [the-year] [site-link] Powered by: SUPER MARTIANS FROM MARS! '.'</div><!-- .copyright -->';
       echo do_shortcode( $output );
    }

    After you've save that file just go and activate the Change Clean Retina Footer plugin. Make sure you change the $output text to what you really want.

    If something goes wrong then just use FTP to delete the new plugin file.

  5. saritlotem
    Member
    Posted 1 year ago #

    Thanks Jan,
    I have created the new footer.php and uploaded it to plugin. when activated, the whole footer.php code appears on top of the site. what did i do wrong?

  6. Uh, dunno. It didn't do that on my install. I wouldn't call the plugin file footer.php but you could.

    Can you post what's in your plugin file that you've created? Also have you made any changes to the theme files?

  7. Latka
    Member
    Posted 1 year ago #

    I can confirm it works. I just used this and I named my php file changeoyay.php and then made a new folder in my plugins directory and put the php file in that directory. Works like a dream ! thanks. LOL infact I liked the "Powered by super martians from mars " so much I just left that on my site. Makes me smile every time I see it. Thanks for the valuable info and the laughs Jan !
    Edited: As I would just like to say I believe that the developers should be credited. It's a very professionally designed theme and one which deserves recognition so I will be changing that powered by martians thing on my site when its properly running

  8. cornh28
    Member
    Posted 1 year ago #

    I created a child theme, and added the style.css file to my folder. The only trouble I had was that my header image went away. Easy to replace, and moved on.

    Then I created and added the functions.php file that Jan suggested above. It added the line about the Martians, but it also kept the old copyright info. So there are now two lines of copyright info, with half of the info duplicated (the first half).

    Am I supposed to go into the original theme's css and remove a line of code, or is my child-theme php file supposed to take care of that removal?

  9. Latka
    Member
    Posted 1 year ago #

    (this part was edited in later I just visited your site and I dont see any footer info in the header and I see your header image, also I see just one line of footer info, however, just incase I am mistaken:)

    cornh28 I followed Jans instructions for the plugin. I didnt bother with his instructions about the child theme. I simply copied his code for the plugin. Made a file called changeoyay.php and pasted the code into that, then on my sites plugin directory made a directory called changeoyay. I put the changeoyay.php file into that and then went into the wordpress plugins and activated it. It worked excellently. The reason you are seeing two is because, I believe, you have now got a plugin, or another bit of code, doing the same job as what the instructions Jan gave for making a child theme are doing. Try reverting back to where you just have a main theme and use the plugin method. Forget the child theme method. One thing I can tell you is dont use notepad to make the php file, use a thing called notepad++ http://notepad-plus-plus.org/
    There is a technical reason for this, notepad++ will mark any syntax defects in the code and enable you to correct them if you copied the code wrongly
    Also, its a moot point but the footer info seems to indicate that a web design company made the website when infact really its just a modified theme. Not lecturing but its slightly disingenuous to claim that the site was made by one company when infact it was only a modification made by that company - but I dont want to distract from the technical discussion

  10. Forget the child theme method.

    Noo! Child themes are cool and are your friend! *drinks more coffee*

    That really is a very neat theme. ;)

    My suggestion really is to do it in a child theme functions.php file and I just used that plugin as an example.

    WordPress is very extendable and actions and filters make it more so. Either will work but from a architectural point of view theme modifications like that generally should be in a child theme's functions.php file.

    *Drinks even more coffee* Or you can use whatever works for you...

    It added the line about the Martians, but it also kept the old copyright info.

    That line I have with add_action( 'init' , 'mh_remove_copy' ); should have removed the old copyright notice. Can you check for typos?

    It's possible that the theme was updated and the action that adds the default copyright may have changed. I don't have that theme installed at the moment but check for typos as that might be the easiest fix.

    If that doesn't do it I'll take a look. Or perhaps the theme author will chime in.

  11. Latka
    Member
    Posted 1 year ago #

    Noo! Child themes are cool and are your friend! *drinks more coffee*

    Not at 5am they arent! I will have to get into child themes, must admit whatever is easiest and gets the job done is king. That plugin did the trick for me so you know what they say "If it aint broke, dont fix it"
    Thanks again for the plugin ! very good work

  12. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    I will have to get into child themes, must admit whatever is easiest and gets the job done is king.

    Not really -- in the long run you will create many more problems for yourself if you modify theme files. You really, really, don't want to go there :).

  13. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Well you can't fix things that aren't broken, so I never understood that saying, but you can really cause havoc to the theme if you don't use a Child Theme.

  14. Latka
    Member
    Posted 1 year ago #

    Advice taken. I will start learning all about child themes.
    Thanks

    Well you can't fix things that aren't broken, so I never understood that saying

    yeah but that's the point, if something is working and it works great and you love it, then trying to make it better will probably destroy it

  15. epigrapisa
    Member
    Posted 1 year ago #

    I've done this:

    That's a neat theme and very organized. But changing the copyright properly requires a little coding.

    First create a child theme for Clean Retina. Put the child theme's style.css file in themes/clean-retina-child.

    /*
    Theme Name: Clean Retina Child Theme
    Author: Self-Help WordPress User
    Template: clean-retina
    */
    
    @import url("../clean-retina/style.css");

    The footer for that theme is added via this action in the parent theme:

    add_action( 'cleanretina_footer', 'cleanretina_footer_info', 25 );

    You want to remove that action and add your own instead. To do that in your child theme directory create a blank functions.php file and add these lines to it.

    <?php
    
    // Remove old copyright text
    add_action( 'init' , 'mh_remove_copy' );
    function mh_remove_copy() {
    	remove_action( 'cleanretina_footer' , 'cleanretina_footer_info ', 25 );
    }
    
    // Add my own copyright text
    add_action( 'cleanretina_footer' , 'mh_footer_info' , 25 );
    function mh_footer_info() {
       $output = '<div class="copyright">'.'Copyright © [the-year] [site-link] Powered by: SUPER MARTIANS FROM MARS! '.'</div><!-- .copyright -->';
       echo do_shortcode( $output );
    }

    Which on your installation should produce something like

    Copyright © 2012 B .Dinelli for Hair Powered by: SUPER MARTIANS FROM MARS!
    You can read about adding and removing actions in child themes at this site.

    http://themeshaper.com/2009/05/25/action-hooks-wordpress-child-themes/

    Hope that helps.

    But this code:

    <?php
    
    // Remove old copyright text
    add_action( 'init' , 'mh_remove_copy' );
    function mh_remove_copy() {
    	remove_action( 'cleanretina_footer' , 'cleanretina_footer_info ', 25 );
    }

    doesn't work, I mean it inserts my copyright, but still doesn't remove the old one.

    Thanks

  16. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    You can seek help within your own thread
    http://wordpress.org/support/forum/themes-and-templates#postform

Topic Closed

This topic has been closed to new replies.

About this Topic