catchresponsive_featured_content_display

Add Featured content.

Description

catchresponsive_featured_content_display(); 

Usage

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

Defined (1)

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

/inc/catchresponsive-featured-content.php  
  1. function catchresponsive_featured_content_display() { 
  2. //catchresponsive_flush_transients(); 
  3.  
  4. global $post, $wp_query; 
  5.  
  6. // get data value from options 
  7. $enablecontent = $options['featured_content_option']; 
  8. $contentselect = $options['featured_content_type']; 
  9.  
  10. // Front page displays in Reading Settings 
  11. $page_on_front = get_option('page_on_front') ; 
  12. $page_for_posts = get_option('page_for_posts'); 
  13.  
  14.  
  15. // Get Page ID outside Loop 
  16. $page_id = $wp_query->get_queried_object_id(); 
  17. if ( 'entire-site' == $enablecontent || ( ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) && 'homepage' == $enablecontent ) ) { 
  18. if ( ( !$catchresponsive_featured_content = get_transient( 'catchresponsive_featured_content_display' ) ) ) { 
  19. $layouts = $options ['featured_content_layout']; 
  20. $headline = $options ['featured_content_headline']; 
  21. $subheadline = $options ['featured_content_subheadline']; 
  22.  
  23. echo '<!-- refreshing cache -->'; 
  24.  
  25. if ( !empty( $layouts ) ) { 
  26. $classes = $layouts ; 
  27.  
  28. if ( 'demo-featured-content' == $contentselect ) { 
  29. $classes .= ' demo-featured-content' ; 
  30. $headline = __( 'Featured Content', 'catch-responsive' ); 
  31. $subheadline = __( 'Here you can showcase the x number of Featured Content. You can edit this Headline, Subheadline and Feaured Content from "Appearance -> Customize -> Featured Content Options".', 'catch-responsive' ); 
  32. elseif ( 'featured-page-content' == $contentselect ) { 
  33. $classes .= ' featured-page-content' ; 
  34.  
  35. //Check Featured Content Position 
  36. $featured_content_position = $options [ 'featured_content_position' ]; 
  37.  
  38. if ( '1' == $featured_content_position ) { 
  39. $classes .= ' border-top' ; 
  40.  
  41. $catchresponsive_featured_content =' 
  42. <section id="featured-content" class="' . $classes . '"> 
  43. <div class="wrapper">'; 
  44. if ( !empty( $headline ) || !empty( $subheadline ) ) { 
  45. $catchresponsive_featured_content .='<div class="featured-heading-wrap">'; 
  46. if ( !empty( $headline ) ) { 
  47. $catchresponsive_featured_content .='<h1 id="featured-heading" class="entry-title">'. $headline .'</h1>'; 
  48. if ( !empty( $subheadline ) ) { 
  49. $catchresponsive_featured_content .='<p>'. $subheadline .'</p>'; 
  50. $catchresponsive_featured_content .='</div><!-- .featured-heading-wrap -->'; 
  51. $catchresponsive_featured_content .=' 
  52. <div class="featured-content-wrap">'; 
  53.  
  54. // Select content 
  55. if ( 'demo-featured-content' == $contentselect && function_exists( 'catchresponsive_demo_content' ) ) { 
  56. $catchresponsive_featured_content .= catchresponsive_demo_content( $options ); 
  57. elseif ( 'featured-page-content' == $contentselect && function_exists( 'catchresponsive_page_content' ) ) { 
  58. $catchresponsive_featured_content .= catchresponsive_page_content( $options ); 
  59.  
  60. $catchresponsive_featured_content .=' 
  61. </div><!-- .featured-content-wrap --> 
  62. </div><!-- .wrapper --> 
  63. </section><!-- #featured-content -->'; 
  64. set_transient( 'catchresponsive_featured_content', $catchresponsive_featured_content, 86940 ); 
  65. echo $catchresponsive_featured_content;