In order to use this code you have to uncheck Enable the footer copyrights and credits
under: Appearance -> Customize -> Footer -> Footer Credits
The following is a code snippet to add your logo in the footer. It will displays your logo only if you have uploaded one, otherwise it will keep the actual credits in your footer.
Copy this code in your functions.php file :
add_filter( 'tc_credits_display', 'my_credits_display' ); function my_credits_display($html) { $logo_src = esc_attr ( tc__f( '__get_option' , 'tc_logo_upload') ) ; if ( empty($logo_src) ) return $html; if ( is_numeric($logo_src) ) { $_attachment_data = wp_get_attachment_image_src( $logo_src , 'large' ); $logo_src = $_attachment_data[0]; } ?> <div class="span4 credits"> <?php $credits = sprintf( '<p> · © %1$s <a href="%2$s" title="%3$s" rel="bookmark">%4$s</a> · Designed by %5$s ·</p>', esc_attr( date( 'Y' ) ), esc_url( home_url() ), esc_attr(get_bloginfo()), '<img src="'.$logo_src.'" alt="'.esc_attr(get_bloginfo()).'">', '<a href="'.TC_WEBSITE.'">Press Customizr</a>' ); echo $credits; ?> </div> <?php }
6 thoughts on “Adding a logo in the footer credits”
Just wondering, where in the php function do you put the logo src pathfile or do you rename the specific logo to the name defined in the php?
Careful with this code. If wrongly nested can create extra white space in php file, which brakes XML parsing (for example with YeostSEO). The error probably
.
Nicolas, first off, thanks for a brilliant theme. Totally love it. I’m trying to
1. add my logo in place of the social footer links
2. include some basic copyright text on the same footer area (using the widget creates another line above the footer that I dont want)
Can you tell me how I could do that?
Thank you again for your amazing theme and the support you provide. You’ve take theme development to a whole new level.
I Richard, i am desperate with the footer credits, since I am looking for a better understanding on how to remove the credits of the footer, and I seen your positive comments on this particular subject I was wondering if you could help me on this matter?
I read everything I could on the forums about this matter, and tryed to understand what to do, but I dont grasp how to do it?
Please find the website I made and my only problem with it is how to remove on th footer the credits and replacing it with my own link, and without adding a logo?
Thanks in advance
Kathleen
Here‘s your answer.