catchresponsive_featured_overall_image

Template for Featured Header Image from theme options.

Description

catchresponsive_featured_overall_image(); 

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


Usage

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

Defined (1)

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

/inc/catchresponsive-custom-header.php  
  1. function catchresponsive_featured_overall_image() { 
  2. global $post, $wp_query; 
  3. $enableheaderimage = $options['enable_featured_header_image']; 
  4.  
  5. // Get Page ID outside Loop 
  6. $page_id = $wp_query->get_queried_object_id(); 
  7.  
  8. $page_for_posts = get_option('page_for_posts'); 
  9.  
  10. // Check Enable/Disable header image in Page/Post Meta box 
  11. if ( is_page() || is_single() ) { 
  12. //Individual Page/Post Image Setting 
  13. $individual_featured_image = get_post_meta( $post->ID, 'catchresponsive-header-image', true ); 
  14.  
  15. if ( 'disable' == $individual_featured_image || ( 'default' == $individual_featured_image && 'disable' == $enableheaderimage ) ) { 
  16. echo '<!-- Page/Post Disable Header Image -->'; 
  17. return; 
  18. elseif ( 'enable' == $individual_featured_image && 'disabled' == $enableheaderimage ) { 
  19.  
  20. // Check Homepage 
  21. if ( 'homepage' == $enableheaderimage ) { 
  22. if ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) { 
  23. // Check Excluding Homepage 
  24. if ( 'exclude-home' == $enableheaderimage ) { 
  25. if ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) { 
  26. return false; 
  27. else { 
  28. elseif ( 'exclude-home-page-post' == $enableheaderimage ) { 
  29. if ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) { 
  30. return false; 
  31. elseif ( is_page() || is_single() ) { 
  32. else { 
  33. // Check Entire Site 
  34. elseif ( 'entire-site' == $enableheaderimage ) { 
  35. // Check Entire Site (Post/Page) 
  36. elseif ( 'entire-site-page-post' == $enableheaderimage ) { 
  37. if ( is_page() || is_single() ) { 
  38. else { 
  39. // Check Page/Post 
  40. elseif ( 'pages-posts' == $enableheaderimage ) { 
  41. if ( is_page() || is_single() ) { 
  42. else { 
  43. echo '<!-- Disable Header Image -->'; 
  44. } // catchresponsive_featured_overall_image