feelfree82

Untitled

Feb 24th, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <div id="blog-sidebar">
  2.  
  3. <div class="more-work-links"><h5>More in Portfolio</h5>
  4. //pulls only 1 post!!!
  5. <?php query_posts(array('post_type'=>'portfolio', 'numberposts' => 5, 'orderby' => 'rand')); ?>
  6. <ul><li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li></ul>
  7. </div>
  8.  
  9. <div class="sidebar-posts">
  10. <h5>Recent Posts</h5>
  11. <ul>
  12. //works fine.
  13. <?php
  14. $args = array( 'numberposts' => 2, 'orderby' => 'rand' );
  15. $rand_posts = get_posts( $args );
  16. foreach( $rand_posts as $post ) : ?>
  17. <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
  18. <?php endforeach; ?>
  19. </ul>
  20. </div>
Advertisement
Add Comment
Please, Sign In to add comment