Post order on homepage from get_posts
-
Hi
First the plugin is just what we need for our new website as other plugins don’t quite work.
How would I get the odering to happen where do I need to add the section name parameters bit?This is my code
<?php
$the_query = get_posts( array(‘category’ => 2006 , ‘numberposts’ => 10 ));
?>
<?phpforeach( $the_query as $post ) : setup_postdata($post);
$link = ‘%s‘;
?>
<div id=”post-<?php the_ID(); ?>” class=”milhouse_single_col”>
<?php if ( has_post_thumbnail() ) {
printf($link,get_the_post_thumbnail(get_the_ID(),’thumbnail’));
}
?>
<h1><?php printf($link,get_the_title()); ?></h1>
<p><?php the_excerpt(); ?>
<?php wp_link_pages( array( ‘before’ => ‘<div class=”page-link”>’ . __( ‘Pages:’, ‘twentyten’ ), ‘after’ => ‘</div>’ ) ); ?>
</p>
</div>
<?php
if ($classPosition==”right”) echo “</div>”;
endforeach;if ($classPosition==”left”) echo “</div>”;
?>
Any help much appreciated THanks
- The topic ‘Post order on homepage from get_posts’ is closed to new replies.