Advertisement
Guest User

WP PageNavi Help

a guest
Jul 29th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.60 KB | None | 0 0
  1. $postID = get_the_ID();                        
  2.     if ( is_front_page() || $postID == 97 ) {
  3.         if ( is_front_page() ) echo "<h1>Road Alerts</h1>";
  4.         echo '<ul id="post-list">';
  5.                            
  6.         if ( is_front_page() ) {
  7.             $new_query = new WP_Query( array('posts_per_page' => 2, 'cat' => 7, 'paged' => get_query_var('paged')) );
  8.         } else if ( $postID == 97 ) {
  9.             $new_query = new WP_Query( array('posts_per_page' => 2, 'cat' => 9, 'paged' => get_query_var('paged')) );
  10.         }
  11.                            
  12.         while ( $new_query->have_posts() ) : $new_query->the_post();
  13.             $meta = get_post_meta(get_the_ID(), $update_metabox->get_the_id(), TRUE);
  14.             $revs = wp_get_post_revisions($id, array('order'=> 'DESC'));                       
  15.             echo '<li>';
  16.                                
  17.             thematic_postheader(); // Gets Post Title enclosed in Post Link and gets Post Meta
  18.             thematic_content();
  19.                                                    
  20.                
  21.                 if ($meta['updates']) { // If Post has updates
  22.                 echo "<div id='post-updates'>";
  23.                 foreach ($meta['updates'] as $update) { // For each update…
  24.                     echo "<div class='post-update'>";
  25.                     echo "<span class='post-update-meta'><strong>Update</strong> on " . $update['post-time'] . "</span>";
  26.                     echo "<p class='post-update-content'>" . $update['post-update'] . "</p>";
  27.                     echo "</div>";
  28.                                        
  29.             } /* end foreach $meta[post-update] */
  30.            
  31.             echo "</div>";
  32.         }
  33.  
  34.         if (function_exists('sharethis_button')) { sharethis_button(); }
  35.     echo '</li>';
  36.     endwhile;
  37.     echo '</ul>';                          
  38.                            
  39.     if(function_exists('wp_pagenavi')) {
  40.         wp_pagenavi( array('query' => $new_query) );
  41.     }
  42.                            
  43.     wp_reset_postdata();
  44. } // end if front or id=97
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement