Created
December 13, 2011 16:21
-
-
Save rawwebdesign/1472747 to your computer and use it in GitHub Desktop.
query_posts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $postid = get_the_ID(); ?> | |
<?php wp_reset_query(); // Restore global post data ?> | |
<?php | |
query_posts(array("showposts" => "12", "post_parent" => $postid, "post_type" => "page")); ?> | |
<div id='whatwedowrapper'> | |
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> | |
<?php | |
$bradthumbimg = "/wp-content/uploads/2011/07/addanimage.png"; | |
if (get_post_meta($post->ID, 'square-thumb', true)) | |
$bradthumbimg = (get_post_meta($post->ID, 'square-thumb', true)); | |
elseif (get_post_meta($post->ID, 'bannerimage', true)) | |
$bradthumbimg = (get_post_meta($post->ID, 'bannerimage', true)); | |
?> | |
<div id='whatwedosingle'> | |
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> | |
<a href='<?php the_permalink(); ?>'> | |
<img src='/scripts/timthumb.php?src=<?php echo $bradthumbimg; ?>&h=100&w=100&q=100' class='photo' /> | |
</a> | |
<div class='whatwedodesc'> | |
<?php the_excerpt(); ?> | |
<a class='reddot' href='<?php the_permalink(); ?>'>Read More</a> | |
</div> | |
</div> | |
<?php endwhile; // end of the loop. ?> | |
</div><!-- what we do wrapper --> | |
<?php wp_reset_query(); // Restore global post data ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment