Advertisement
pratikshrestha

Fabulous Fluid Pro Remove Load More

Aug 30th, 2016
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.33 KB | None | 0 0
  1. function fabulous_fluid_featured_grid_content() {
  2. //fabulous_fluid_flush_transients();
  3. global $post, $wp_query;
  4.  
  5. // get data value from options
  6. $enable_content = apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_option' );
  7. $content_select = apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_type' );
  8.  
  9. // Front page displays in Reading Settings
  10. $page_on_front = get_option('page_on_front') ;
  11. $page_for_posts = get_option('page_for_posts');
  12.  
  13.  
  14. // Get Page ID outside Loop
  15. $page_id = $wp_query->get_queried_object_id();
  16. if ( 'entire-site' == $enable_content || ( ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) && 'homepage' == $enable_content ) ) {
  17. if ( ( !$featured_grid_content = get_transient( 'fabulous_fluid_featured_grid_content' ) ) ) {
  18.  
  19. echo '<!-- refreshing cache -->';
  20.  
  21. $featured_grid_content ='
  22. <div id="featured-grid-content" class="featured-posts ' . $content_select . '">
  23. <div class="wrapper">';
  24. // Select content
  25. if ( $content_select == 'demo-content' && function_exists( 'fabulous_fluid_demo_grid_content' ) ) {
  26. $featured_grid_content .= fabulous_fluid_demo_grid_content();
  27. }
  28. else if ( $content_select == 'post-content' && function_exists( 'fabulous_fluid_grid_post_content' ) ) {
  29. $featured_grid_content .= fabulous_fluid_grid_post_content();
  30. }
  31. elseif ( $content_select == 'page-content' && function_exists( 'fabulous_fluid_grid_page_content' ) ) {
  32. $featured_grid_content .= fabulous_fluid_grid_page_content();
  33. }
  34. elseif ( $content_select == 'category-content' && function_exists( 'fabulous_fluid_grid_category_content' ) ) {
  35. $featured_grid_content .= fabulous_fluid_grid_category_content();
  36. }
  37. elseif ( $content_select == 'image-content' && function_exists( 'fabulous_fluid_grid_image_content' ) ) {
  38. $featured_grid_content .= fabulous_fluid_grid_image_content();
  39. }
  40.  
  41. $featured_grid_content .='
  42. </div><!-- .wrapper -->
  43. </div><!-- .featured-posts -->';
  44.  
  45. set_transient( 'fabulous_fluid_featured_grid_content', $featured_grid_content, 86940 );
  46. }
  47.  
  48. echo $featured_grid_content;
  49. }
  50. }
  51.  
  52. function fabulous_fluid_grid_image_content() {
  53. $quantity = apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_number' );
  54.  
  55. if ( 1 > $quantity ) {
  56. //Bail if quantity is less than 1
  57. return;
  58. }
  59.  
  60. $output = '';
  61.  
  62. $j = 1;
  63.  
  64. $output .= '<div class="row odd">';
  65.  
  66. for ( $i = 1; $i <= $quantity; $i++ ) {
  67. $show_content = apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_show' );
  68.  
  69. $target = '_self';
  70. $link = '#';
  71. $title = '';
  72. $content = '';
  73. $date ='';
  74.  
  75. if ( apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_target_' . $i ) ) {
  76. $target = '_blank';
  77. }
  78.  
  79. //Checking Link
  80. if ( apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_link_' . $i ) ) {
  81. //support qTranslate plugin
  82. if ( function_exists( 'qtrans_convertURL' ) ) {
  83. $link = qtrans_convertURL( apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_link_' . $i ) );
  84. }
  85. else {
  86. $link = apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_link_' . $i );
  87. }
  88. }
  89.  
  90. //Checking Title
  91. if ( apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_title_' . $i ) ) {
  92. $title = apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_title_' . $i );
  93. }
  94.  
  95. //Checking Content
  96. if ( apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_content_' . $i ) ) {
  97. $content = apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_content_' . $i );
  98. }
  99.  
  100. if ( apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_date_' . $i ) ) {
  101. $date = '<div class="meta-info">
  102. <span class="posted-on">'. apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_date_' . $i ) .'
  103. </span>
  104. </div>';
  105. }
  106.  
  107. $class = 'col col-small';
  108.  
  109. if ( 1 == $i%3 ) {
  110. $class = 'col col-large';
  111. }
  112.  
  113. $output .= '
  114. <div class="' . $class . '">';
  115.  
  116. $output .= '
  117. <div id="featured-image-' . $i . '" class="post">';
  118.  
  119. $output .= '
  120. <div class="text-holder">
  121. <header class="entry-header">
  122. <h2 class="entry-title">
  123. <a href="' . esc_url( $link ) . '" rel="bookmark" target="' . esc_attr( $target ) . '">' . esc_html( $title ) . '</a>
  124. </h2>
  125. ' . $date . '
  126. </header><!-- .entry-header -->';
  127.  
  128. if ( '' != $content ) {
  129. $output .= '<div class="entry-content"><p>' . $content . '</p></div><!-- .entry-content -->';
  130. }
  131. $output .= '
  132. </div><!-- .text-holder -->
  133.  
  134. <div class="img-holder">
  135. <a href="' . esc_url( $link ) . '" target="' . esc_attr( $target ) . '">
  136. <img src="'. esc_url( apply_filters( 'fabulous_fluid_get_option', 'featured_grid_content_image_' . $i ) ) .'" class="wp-post-image" alt="'. esc_attr( $title ) .'" title="'. esc_attr( $title ) .'">
  137. </a>
  138. </div><!-- .img-holder -->
  139. </div><!-- #featured-post-'. $i .'.post -->';
  140.  
  141. $output .= '
  142. </div><!-- .col-large.col-small -->';
  143.  
  144. if ( 0 == $i%3 ) {
  145. $j++;
  146.  
  147. $class = ( 0 == $j%2 ) ? 'even' : 'odd';
  148. $output .= '
  149. </div><!-- .row -->
  150.  
  151. <div class="row ' . $class .'">';
  152. }
  153. }
  154.  
  155. return $output;
  156. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement