layers_header_meta

The Layers layers header meta function.

Description

layers_header_meta(); 

Usage

  1. if ( !function_exists( 'layers_header_meta' ) ) { 
  2. require_once '/core/helpers/template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = layers_header_meta(); 
  7.  

Defined (1)

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

/core/helpers/template.php  
  1. function layers_header_meta() { 
  2. wp_reset_query(); 
  3.  
  4. if( is_single() || is_page() ) { ?> 
  5. <meta property="og:title" content="<?php the_title(); ?>" /> 
  6. <?php if( '' != get_the_excerpt() ) { ?> 
  7. <meta property="og:description" content="<?php echo esc_attr( get_the_excerpt() ); ?>" /> 
  8. <?php } ?> 
  9. <meta property="og:type" content="website" /> 
  10. <meta property="og:url" content="<?php the_permalink(); ?>" /> 
  11. <?php if( has_post_thumbnail() ) { 
  12. $image_url = wp_get_attachment_url( get_post_thumbnail_id() ); ?> 
  13. <meta property="og:image" content="<?php echo $image_url; ?>" /> 
  14. <?php } ?> 
  15. <?php } else { ?> 
  16. <meta property="og:title" content="<?php wp_title(); ?>" /> 
  17. <meta property="og:description" content="<?php echo get_bloginfo( 'description' ); ?>" /> 
  18. <meta property="og:type" content="website" /> 
  19. <meta property="og:url" content="<?php home_url(); ?>" /> 
  20. <?php $logo = get_option( site_logo ); 
  21. if( is_array( $logo ) && isset( $logo[ 'url' ] ) ) { ?> 
  22. <meta property="og:image" content="<?php echo esc_url( $logo['url'] ); ?>" /> 
  23. <?php } ?> 
  24. <?php }