Adding a logo in the footer credits

Notice for  Customiz-Pro (<1.2.5) users:
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”

Comments are closed.