Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="blog-sidebar">
- <div class="more-work-links"><h5>More in Portfolio</h5>
- //pulls only 1 post!!!
- <?php query_posts(array('post_type'=>'portfolio', 'numberposts' => 5, 'orderby' => 'rand')); ?>
- <ul><li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li></ul>
- </div>
- <div class="sidebar-posts">
- <h5>Recent Posts</h5>
- <ul>
- //works fine.
- <?php
- $args = array( 'numberposts' => 2, 'orderby' => 'rand' );
- $rand_posts = get_posts( $args );
- foreach( $rand_posts as $post ) : ?>
- <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
- <?php endforeach; ?>
- </ul>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment