overlay-menu-logo.php 928 B

12345678910111213141516171819202122232425
  1. <?php
  2. $logo_url = rd_vamtam_get_option( 'custom-header-logo-transparent' );
  3. $attachment = attachment_url_to_postid( $logo_url );
  4. if ( ! empty( $logo_url ) ) :
  5. $logo_meta = get_post_meta( $attachment, '_wp_attachment_metadata', true );
  6. $logo_size = array(
  7. 'width' => isset( $logo_meta['width'] ) ? intval( $logo_meta['width'] ) : 0,
  8. 'height' => isset( $logo_meta['height'] ) ? intval( $logo_meta['height'] ) : 0,
  9. );
  10. $max_height = 0;
  11. if ( ! empty( $logo_size['height'] ) ) {
  12. $max_height = $logo_size['height'] / 2;
  13. $logo_style = "max-height: {$max_height}px;";
  14. }
  15. $logo_hw_string = empty( $logo_size['width'] ) ? '' : image_hwstring( $logo_size['width'] / 2, $logo_size['height'] / 2 );
  16. ?>
  17. <div class="vamtam-overlay-menu-logo">
  18. <img src="<?php echo esc_url( $logo_url ) ?>" alt="<?php bloginfo( 'name' )?>" class="menu-logo" <?php echo $logo_hw_string; // xss ok ?> />
  19. </div>
  20. <?php endif ?>