catchresponsive_single_content_image

Template for Featured Image in Single Post.

Description

catchresponsive_single_content_image(); 

To override this in a child theme simply create your own catchresponsive_single_content_image(), and that function will be used instead.


Usage

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

Defined (1)

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

/inc/catchresponsive-core.php  
  1. function catchresponsive_single_content_image() { 
  2. global $post, $wp_query; 
  3.  
  4. // Getting data from Theme Options 
  5.  
  6. $featured_image = $options['single_post_image_layout']; 
  7.  
  8. // Get Page ID outside Loop 
  9. $page_id = $wp_query->get_queried_object_id(); 
  10.  
  11. if ( $post ) { 
  12. if ( is_attachment() ) { 
  13. $parent = $post->post_parent; 
  14. $individual_featured_image = get_post_meta( $parent, 'catchresponsive-featured-image', true ); 
  15. } else { 
  16. $individual_featured_image = get_post_meta( $page_id, 'catchresponsive-featured-image', true ); 
  17.  
  18. if ( empty( $individual_featured_image ) || ( !is_page() && !is_single() ) ) { 
  19. $individual_featured_image = 'default'; 
  20.  
  21. if ( ( 'disable' == $individual_featured_image || '' == get_the_post_thumbnail() || ( $individual_featured_image=='default' && 'disabled' == $featured_image) ) ) { 
  22. echo '<!-- Page/Post Single Image Disabled or No Image set in Post Thumbnail -->'; 
  23. return false; 
  24. else { 
  25. $class = ''; 
  26.  
  27. if ( 'default' == $individual_featured_image ) { 
  28. $class = $featured_image; 
  29. else { 
  30. $class = 'from-metabox ' . $individual_featured_image; 
  31.  
  32. ?> 
  33. <figure class="featured-image <?php echo $class; ?>"> 
  34. <?php 
  35. if ( 'featured' == $individual_featured_image || ( $individual_featured_image=='default' && 'featured' == $featured_image ) ) { 
  36. the_post_thumbnail( 'catchresponsive-featured' ); 
  37. else { 
  38. the_post_thumbnail( 'full' ); 
  39. } ?> 
  40. </figure> 
  41. <?php