Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // display a list of recent case studies
- // instantiate an instance of WP_Query as a variable $recentPosts
- $recentPosts = new WP_Query();
- // get last 10 posts from category 7 (case studies)
- $recentPosts->query('showposts=4&cat=4');
- // utilize two methods to get at template tags (below)
- while ($recentPosts->have_posts()) :
- $recentPosts->the_post();
- ?>
- <div class="slide" ><a href="<?php // bump out what we need courtesy of template tags
- the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><h2><?php the_title(); ?></h2><?php echo excerpt(20); ?></a></div>
- <?php endwhile; ?>
- <?php
- $args = array( 'numberposts' => 6, 'order'=> 'DESC', 'orderby' => 'post_date', 'category' => 3 );
- $postslist = get_posts( $args );
- foreach ($postslist as $post) : setup_postdata($post);
- ?>
- <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
- <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement