Support » Developing with WordPress » Removing WordPress and Theme Credits from Theme Footer

  • Resolved designhousewebsolutions

    (@designhousewebsolutions)


    Usually I can remove the wordpress and theme credits from the bottom of my sites however this footer.php is stumping me and I cant seem to see where the credits are to remove them. Any help welcome! I’ve posted the footer.php code below:

    </div><!– #main –>
    
    <?php
    /**
    * cleanretina_after_main hook
    */
    do_action( ‘cleanretina_after_main’ );
    ?>
    
    <?php
    /**
    * cleanretina_before_footer hook
    */
    do_action( ‘cleanretina_before_footer’ );
    ?>
    
    <footer id=”colophon” class=”clearfix”>
    <?php
    /**
    * cleanretina_footer hook
    *
    * HOOKED_FUNCTION_NAME PRIORITY
    *
    * cleanretina_open_wrapper_div 5
    * cleanretina_footer_widget_area 10
    * cleanretina_open_sitegenerator_div 15
    * cleanretina_socialnetworks 20
    * cleanretina_footer_info 25
    * cleanretina_close_sitegenerator_div 30
    * cleanretina_close_wrapper_div 35
    * cleanretina_backtotop_html 40
    */
    do_action( ‘cleanretina_footer’ );
    ?>
    </footer>
    
    <?php
    /**
    * cleanretina_after_footer hook
    */
    do_action( ‘cleanretina_after_footer’ );
    ?>
    
    </div><!– #wrapper –>
    
    <?php
    /**
    * cleanretina_after hook
    */
    do_action( ‘cleanretina_after’ );
    ?>
    
    <?php wp_footer(); ?>
    
    </body>
    </html>

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

    • This topic was modified 2 years, 1 month ago by  bdbrown.
Viewing 14 replies - 1 through 14 (of 14 total)
  • Att this to your custom css file:

    /*Remove Proudly powered by.. */
    .site-info {
      display: none;
    }

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

    If your theme has that option just paste it through the customizer. If not, then Create a child theme and add that to the css.

    • This reply was modified 2 years, 1 month ago by  bdbrown.
    • This reply was modified 2 years, 1 month ago by  bdbrown.
    designhousewebsolutions

    (@designhousewebsolutions)

    Didnt work. Not sure if I’m putting it in the wrong place. Apologies and thanks for your help! I tried putting it into custom css and also into main stylesheet and also in the footer.php

    Try this in functions.php:

    function add_remove_credit(){?>
      <style>
    /*Remove Proudly powered by.. */
    .site-info {
      display: none;
    }
      </style>
     <?php }
    add_action( 'wp_enqueue_scripts', 'add_remove_credit' );

    I just downloaded that theme (Clean retina) and tried it on a local install to have a look out of curiosity, and I see that there is a directory named footer_info here wp-content/themes/clean-retina/library/footer_info
    inside is a file named cleanretina-footer_info.php edit that file to change credits. Here is the code at the end of that file:

    function cleanretina_wp_link() {
       return '<a href="'.esc_url( 'http://wordpress.org' ).'" target="_blank" title="' . esc_attr__( 'WordPress', 'clean-retina' ) . '"><span>' . __( 'WordPress', 'clean-retina' ) . '</span></a>';
    }
    /**
     * To display a link to cleanretina.com.
     *
     * @return string
     */
    function cleanretina_themehorse_link() {
       return '<a href="'.esc_url( 'http://themehorse.com' ).'" target="_blank" title="'.esc_attr__( 'Theme Horse', 'clean-retina' ).'" ><span>'.__( 'Theme Horse', 'clean-retina') .'</span></a>';
    }
    ?>

    `

    • This reply was modified 2 years, 1 month ago by  stanwilliams.
    • This reply was modified 2 years, 1 month ago by  stanwilliams. Reason: typos
    • This reply was modified 2 years, 1 month ago by  stanwilliams.
    • This reply was modified 2 years, 1 month ago by  stanwilliams.
    • This reply was modified 2 years, 1 month ago by  stanwilliams.

    P.S. you still need do something like use the Custom CSS that @starapple suggested to remove the “Powered by WordPress” from the footer.
    I just made this screenshot:
    Screenshot I just made

    • This reply was modified 2 years, 1 month ago by  stanwilliams.
    • This reply was modified 2 years, 1 month ago by  stanwilliams. Reason: add info
    • This reply was modified 2 years, 1 month ago by  stanwilliams.

    If a theme file needs to be edited for a core WordPress functionality, it’s either time to change themes or the theme developer needs to be aletred to fix the problem. Both the [lain css and the version wrapped in a function work in a normal functioning theme.

    Try using some javascript on the the html tags that output the credit. Eg:

    add_action('wp_enqueue_scripts', 'add_remove_credit');
    function add_remove_credit(){ ?>
    <script type="text/javascript">document.getElementById("ID OF ELEMENT").hide();
    </script>
    <?php } 

    View the page source to get the id of the div or whatever element the text is in and replace the text ID OF ELEMENT. Using remove() instead of hide() may be better since nothing will be sent to the browser (source).

    • This reply was modified 2 years, 1 month ago by  starapple.

    This ^ goes in the theme’s functions.php

    @starapple I agree ! I was just finding a way to accomplish it and of course unless it was incorporated into a child theme it would all be lost at the first theme update anyway.
    And I was just at their support forum and saw this post in reply to someone who wnated to remove “Powered by…” from the footer:
    http://www.themehorse.com/support-forum/topic/removing-the-footer/
    “Hi eco_p,

    You cannot remove footer and we cannot help you. IF you are good at coding then you can customize the code but create child theme while customizing the code because while updating to new version your customized code will not be lost. Upgrade to premium features will helps to remove the credit link as it is our premium feature.

    Thank you”
    So I agree with I would either use his functions code or Another theme.

    • This reply was modified 2 years, 1 month ago by  stanwilliams.
    • This reply was modified 2 years, 1 month ago by  stanwilliams.
    • This reply was modified 2 years, 1 month ago by  stanwilliams.

    @stanwilliams,

    It seems the theme’s author wants to keep a link in the free version, which is fair enough. But if it’s an open source free usage licence then, no problem with @designhousewebsolutions removing it if keeping it is not a condition of free usage.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    You cannot remove footer and we cannot help you.

    Wait. What?

    @designhousewebsolutions Is this the theme?

    https://wordpress.org/themes/clean-retina/

    I’m pretty sure it is but if you can confirm then I’ll create a child theme that successfully removes the credit and provide those instructions.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Back to the orgiinal question:

    Usually I can remove the wordpress and theme credits from the bottom of my sites however this footer.php is stumping me and I cant seem to see where the credits are to remove them.

    It’s easy, you just need to create and activate a child theme.

    1. Install the Clean Retina theme. Don’t activate it.

    https://wordpress.org/themes/clean-retina/

    2. In wp-content/themes create a directory named clean-retina-child and in that directory create a style.css file with this in it.

    
    /*
    Theme Name: Clean Retina Child theme
    Description: A Child theme to remove the credits from Clean Retina
    Version: 0.1
    Template: clean-retina
    */
    

    3. In that same clean-retina-child directory create an functions.php file with just these lines in it. Do not copy any files from the parent clean-retina directory. It’s not necessary.

    https://gist.github.com/jdembowski/fd0c5dcb1515dbe1f96b2e4b8fc85e32

    
    <?php
    
    // Queue up the child theme CSS
    add_action( 'wp_enqueue_scripts', 'cleanretina_child_enqueue_styles' );
    
    function cleanretina_child_enqueue_styles() {
    
        $parent_style = 'parent-style';
    
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style ),
            wp_get_theme()->get('Version')
        );
    }
    
    // After the theme is setup remove the cleanretina_footer action from the parent theme
    add_action( 'after_setup_theme', 'mh_remove_credits' );
    
    function mh_remove_credits() {
    
            // Remove old credits from footer
            remove_action( 'cleanretina_footer', 'cleanretina_footer_info', 25 );
            // Add the replacement footer. Modify $output to whatever you like
            add_action( 'cleanretina_footer', 'mh_cleanretina_footer_info', 25 );
    
    }
    
    function mh_cleanretina_footer_info() {
    
       $output = '<div class="copyright">' . __( 'Copyright &copy;', 'clean-retina' ) . ' ';
       $output .= cleanretina_the_year().' ' .cleanretina_site_link();
       $output .= ' | ' . ' ' .__( 'Theme by:', 'clean-retina' ) . ' ' . cleanretina_themehorse_link();
       $output .= ' | ' . ' ' . __( 'Powered by:', 'clean-retina' );
       $output .= ' ' . cleanretina_wp_link() . '</div><!-- .copyright -->';
    
       echo $output;
    }
    

    4. In your WordPress dashboard locate and active the theme named Clean Retina Child Theme.

    Modify the $output in the child theme’s functions.php to whatever you like. You can remove the credits or make any changes you want.

    • This reply was modified 2 years, 1 month ago by  Jan Dembowski.
    • This reply was modified 2 years, 1 month ago by  Jan Dembowski. Reason: Moved the add_action inside the after_setup_theme

    @designhousewebsolutions, is it possible to post a link to a page with the credit in trhe footer? I’ll just take a look at it to see what tag it’s nested in to get its id and include it in the snippet I posted earlier for your functions.php.

    OK, it’s not an id but a class name, “copyright”

    Here’s revised code with the complete script:

    add_action('wp_enqueue_scripts', 'add_remove_credit');
    function add_remove_credit(){ ?>
    <script type="text/javascript">document.getElementsByClassName("copyright").remove();
    </script>
    <?php }

    Stick that at the end of functions.php or anywhere it doesn’t break the code and you should be good to go.

    designhousewebsolutions

    (@designhousewebsolutions)

    Sorry for the delay in responding I have been away with work. I tried a couple of the options above but it seemed to be beyond me so I gave in and tried an alternative theme.

    Thanks everyone however for your help really appreciate it!!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Removing WordPress and Theme Credits from Theme Footer’ is closed to new replies.