megaresponsive_lite_loop_callback

The CWP MegaResponsive megaresponsive lite loop callback function.

Description

megaresponsive_lite_loop_callback(); 

Usage

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

Defined (1)

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

/functions.php  
  1. function megaresponsive_lite_loop_callback() { 
  2.  
  3. global $post; 
  4.  
  5. $numPosts = (isset($_GET['numPosts'])) ? $_GET['numPosts'] : 0; 
  6.  
  7. $page = (isset($_GET['pageNumber'])) ? $_GET['pageNumber'] : 0; 
  8.  
  9. $catt = (isset($_GET['catNumber'])) ? $_GET['catNumber'] : -1; 
  10.  
  11. $yearr = (isset($_GET['yearPar'])) ? $_GET['yearPar'] : -1; 
  12.  
  13. $monthh = (isset($_GET['monthPar'])) ? $_GET['monthPar'] : -1; 
  14.  
  15. $authorr = (isset($_GET['authorPar'])) ? $_GET['authorPar'] : -1; 
  16.  
  17. $tagg = (isset($_GET['tagPar'])) ? $_GET['tagPar'] : -1; 
  18.  
  19. if( $catt != -1 ): 
  20.  
  21. query_posts(array( 
  22.  
  23. 'posts_per_page' => $numPosts,  
  24.  
  25. 'paged' => $page,  
  26.  
  27. 'cat' => $catt,  
  28.  
  29. 'post_status' => 'publish',  
  30.  
  31. 'post__not_in' => get_option( 'sticky_posts' ) 
  32.  
  33. )); 
  34.  
  35. elseif( ($yearr != -1) && ($monthh != -1) ): 
  36.  
  37. query_posts(array( 
  38.  
  39. 'posts_per_page' => $numPosts,  
  40.  
  41. 'paged' => $page,  
  42.  
  43. 'year' => $yearr,  
  44.  
  45. 'monthnum' => $monthh,  
  46.  
  47. 'post_status' => 'publish',  
  48.  
  49. 'post__not_in' => get_option( 'sticky_posts' ) 
  50.  
  51. )); 
  52.  
  53. elseif( $yearr != -1 ): 
  54.  
  55. query_posts(array( 
  56.  
  57. 'posts_per_page' => $numPosts,  
  58.  
  59. 'paged' => $page,  
  60.  
  61. 'year' => $yearr,  
  62.  
  63. 'post_status' => 'publish',  
  64.  
  65. 'post__not_in' => get_option( 'sticky_posts' ) 
  66.  
  67. )); 
  68.  
  69. elseif( $authorr != -1 ): 
  70.  
  71. query_posts(array( 
  72.  
  73. 'posts_per_page' => $numPosts,  
  74.  
  75. 'paged' => $page,  
  76.  
  77. 'author' => $authorr,  
  78.  
  79. 'post_status' => 'publish',  
  80.  
  81. 'post__not_in' => get_option( 'sticky_posts' ) 
  82.  
  83. )); 
  84.  
  85. elseif($tagg != -1): 
  86.  
  87. query_posts(array( 
  88.  
  89. 'posts_per_page' => $numPosts,  
  90.  
  91. 'paged' => $page,  
  92.  
  93. 'tag' => $tagg,  
  94.  
  95. 'post_status' => 'publish',  
  96.  
  97. 'post__not_in' => get_option( 'sticky_posts' ) 
  98.  
  99. )); 
  100.  
  101. else: 
  102.  
  103. query_posts(array( 
  104.  
  105. 'posts_per_page' => $numPosts,  
  106.  
  107. 'paged' => $page,  
  108.  
  109. 'post_status' => 'publish',  
  110.  
  111. 'post__not_in' => get_option( 'sticky_posts' ) 
  112.  
  113. )); 
  114.  
  115. endif; 
  116.  
  117. while ( have_posts() ) : the_post(); ?> 
  118.  
  119.  
  120. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 
  121.  
  122. <header class="entry-header"> 
  123.  
  124. <?php 
  125.  
  126. if ( has_post_thumbnail() ): 
  127.  
  128. echo '<div class="entry-thumbnail"> '; 
  129.  
  130. echo '<a href="'.get_permalink().'" title="'.get_the_title().'" rel="bookmark">'; 
  131.  
  132. the_post_thumbnail(array(250, 250), array('class' => 'alignleft')); 
  133.  
  134. echo '</a>'; 
  135.  
  136. echo '</div>'; 
  137.  
  138. endif; 
  139.  
  140. ?> 
  141.  
  142. <div class="entry-meta meta-top"> 
  143.  
  144. <div class="post-categories"> 
  145.  
  146. <?php the_category(' / '); ?> 
  147.  
  148. </div> 
  149.  
  150. <?php if ( 'post' == get_post_type() ) : ?> 
  151.  
  152. <div class="entry-meta"> 
  153.  
  154.  
  155. </div><!-- .entry-meta --> 
  156.  
  157. <?php endif; ?>  
  158.  
  159. </div> 
  160.  
  161. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2> 
  162.  
  163. </header><!-- .entry-header --> 
  164.  
  165.  
  166.  
  167. <?php if ( is_search() ) : // Only display Excerpts for Search ?> 
  168.  
  169. <div class="entry-summary"> 
  170.  
  171. <?php the_excerpt(); ?> 
  172.  
  173. </div><!-- .entry-summary --> 
  174.  
  175. <?php else : ?> 
  176.  
  177. <div class="entry-content"> 
  178.  
  179. <?php the_excerpt();  
  180.  
  181. wp_link_pages( array( 
  182.  
  183. 'before' => '<div class="page-links">' . __( 'Pages:', 'megaresponsive-lite' ),  
  184.  
  185. 'after' => '</div>',  
  186.  
  187. ) ); 
  188.  
  189. ?> 
  190.  
  191. </div><!-- .entry-content --> 
  192.  
  193. <?php endif; ?> 
  194.  
  195.  
  196.  
  197. </article><!-- #post-## --> 
  198.  
  199.  
  200. <?php endwhile; 
  201.  
  202.  
  203. die(); // this is required to return a proper result 
  204.