cristiansans (owner)

Revisions

gist: 165791 Download_button fork
public
Public Clone URL: git://gist.github.com/165791.git
Embed All Files: show embed
random projects on home with wordpress - conquistadors #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!-- Random project -->
<?php if (have_posts()) : ?>
<?php query_posts('showposts=1&cat=3&orderby=rand'); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<?php if (is_attachment()) : ?>
<?php $attachments = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order'));
$first_attachment = array_shift($attachments); ?>
<?php echo wp_get_attachment_image($first_attachment->ID); ?>
<?php else : ?>
<img src="<?php bloginfo('template_directory'); ?>/img/noimage.png" width="200" height="100" alt="The Conquistadors Collective" />
<?php endif; ?>
<div class="entry">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>" class="more">View more</a>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<!-- //Random project -->