jetpack_the_site_logo

Output an tag of the site logo, at the size specified in the theme's add_theme_support() declaration.

Description

jetpack_the_site_logo(); 

Usage

  1. if ( !function_exists( 'jetpack_the_site_logo' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/theme-tools/site-logo/inc/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = jetpack_the_site_logo(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/modules/theme-tools/site-logo/inc/functions.php  
  1. function jetpack_the_site_logo() { 
  2. $logo =site_logo)->logo; 
  3. $size =site_logo)->theme_size(); 
  4. $html = ''; 
  5.  
  6. // If no logo is set, but we're in the Customizer, leave a placeholder (needed for the live preview). 
  7. if ( ! jetpack_has_site_logo() ) { 
  8. $html = sprintf( '<a href="%1$s" class="site-logo-link" style="display:none;"><img class="site-logo" data-size="%2$s" /></a>',  
  9. esc_url( home_url( '/' ) ),  
  10. esc_attr( $size ) 
  11. ); 
  12.  
  13. // We have a logo. Logo is go. 
  14. else { 
  15. $html = sprintf( '<a href="%1$s" class="site-logo-link" rel="home" itemprop="url">%2$s</a>',  
  16. esc_url( home_url( '/' ) ),  
  17. wp_get_attachment_image( 
  18. $logo['id'],  
  19. $size,  
  20. false,  
  21. array( 
  22. 'class' => "site-logo attachment-$size",  
  23. 'data-size' => $size,  
  24. 'itemprop' => "logo" 
  25. ); 
  26.  
  27. /** 
  28. * Filter the Site Logo output. 
  29. * @module theme-tools 
  30. * @since 3.2.0 
  31. * @param string $html Site Logo HTML output. 
  32. * @param array $logo Array of Site Logo details. 
  33. * @param string $size Size specified in add_theme_support declaration, or 'thumbnail' default. 
  34. */ 
  35. echo apply_filters( 'jetpack_the_site_logo', $html, $logo, $size );