Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.97 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: PageOfPosts
  4. Modified for iNove Theme in WP 2.8 by Robert Savage.
  5. */
  6. wp_enqueue_script( 'jquery' );
  7. get_header();
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. $options = get_option('inove_options');
  17. if (function_exists('wp_list_comments'))
  18. {
  19.     add_filter('get_comments_number', 'comment_count', 0);
  20. }
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. // if this is a certain page ID, then set the category to a specific category id.
  30. if (is_page('19') )
  31. {
  32.   $cat = array(4);
  33. }
  34.  
  35. else
  36. {
  37.   $cat = '';
  38. }
  39.  
  40. $showposts = 3; // -1 shows all posts
  41. $do_not_show_stickies = 1; // 0 to show stickies
  42. $args=array(
  43.    'category__in' => $cat,
  44.    'showposts' => $showposts,
  45.    'caller_get_posts' => $do_not_show_stickies,
  46.    
  47.    );
  48. $my_query = new WP_Query($args);
  49.  
  50. ?>
  51.  
  52. <?php
  53.     //get_sidebar();
  54. ?>
  55. <script type="text/javascript">
  56.  
  57.    
  58.     jQuery(document).ready(function($) {
  59.     // $() will work as an alias for jQuery() inside of this function
  60.        
  61.        
  62.         $('.intro').click(function() {
  63.            
  64.             $(this).animate({
  65.                 height : 'toggle',
  66.                 opacity: 'toggle'
  67.             }, 500)
  68.                 .parent('.content').children('.whole').animate({
  69.                     height : 'toggle',
  70.                     opacity: 'toggle'
  71.                    
  72.                 }, 500);
  73.            
  74.         });
  75.         $('.whole').click(function() {
  76.        
  77.             $(this).parent('.content').children('.whole').animate({
  78.                 height : 'toggle',
  79.                 opacity: 'toggle'
  80.                
  81.             }, 500)
  82.                
  83.                 .parent('.content').children('.intro').animate({
  84.                     height : 'toggle',
  85.                     opacity: 'toggle'
  86.                 }, 500);
  87.            
  88.         });
  89.        
  90.        
  91.        
  92.     });
  93.  
  94.    
  95.  
  96. </script>
  97.  
  98.  
  99.  
  100.  
  101. <div id="primary"  class="hfeed" style="width: 720px;">
  102.     <?php if( $my_query->have_posts() ) : ?>
  103.  
  104.         <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
  105.             <?php
  106.            
  107.             //necessary to show the tags
  108.             global $wp_query;
  109.             $wp_query->in_the_loop = true;
  110.             ?>
  111.            
  112.            
  113.             <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
  114.  
  115.                     <div class="post-thumbnail-div">
  116.                         <?php the_post_thumbnail('post-thumbnails'); ?>
  117.                     </div>
  118.                    
  119.                     <div class="post-entry-div" style="width: 600px;">
  120.  
  121.                                 <h3>
  122.                                     <!-- THE TITLE -->
  123.                                     <a class="title" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
  124.                                 </h3>
  125.  
  126.                            
  127.                                  <div class="info">
  128.                                     <span class="date"><?php the_time(__('F jS, Y', 'inove')) ?></span>
  129.                                     <?php if ($options['author']) : ?><span class="author"><?php the_author_posts_link(); ?></span><?php endif; ?>
  130.                                     <?php edit_post_link(__('Edit', 'inove'), '<span class="editpost">', '</span>'); ?>
  131.                                     <span class="comments"><?php comments_popup_link(__('No comments', 'inove'), __('1 comment', 'inove'), __('% comments', 'inove'), '', __('Comments off', 'inove')); ?></span>
  132.                                     <div class="fixed"></div>
  133.                                 </div>
  134.  
  135.  
  136.                             <div class="content">
  137.                                
  138.                                 <?php //the_content(__('CONTINUE READING->', 'inove')); ?>
  139.                                 <div class="intro"><?php echo content('50'); ?></div>
  140.                                 <div class="whole"><?php the_content(); ?></div>
  141.                                
  142.                                 <a href=<?php the_permalink() ?> >Read More</a>
  143.  
  144.  
  145.                                 <div class="fixed"></div>
  146.                             </div>
  147.  
  148.                             <div class="under">
  149.                                     <span class="date">Posted at  <?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?> </span>                                                              
  150.                                     <span class="comments"><?php comments_popup_link(__('No comments', 'inove'), __('1 comment', 'inove'), __('% comments', 'inove'), '', __('Comments off', 'inove')); ?></span>
  151.                                     <div class="fixed"></div>
  152.                             </div>
  153.                            
  154.                            
  155.                     </div>
  156.                            
  157.                            
  158.                
  159.             </div>
  160.            
  161.            
  162.         <?php endwhile; ?>
  163.  
  164.        
  165.        
  166.      <div id="pagenavi">
  167.             <?php
  168.                 kriesi_pagination(6,6);
  169.  
  170.             ?>
  171.         <div class="fixed"></div>
  172.     </div>    
  173.    
  174.  
  175.  
  176.     <?php else : ?>
  177.  
  178.         <div class="errorbox">
  179.             <?php _e('Sorry, no posts matched your criteria.', 'inove'); ?>
  180.         </div>
  181.  
  182.     <?php endif; ?>
  183.  
  184.     </div>
  185.  
  186. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement