Something like the following ( may not be completely accurate ). For the thumbnail you could run get_post_meta()
or better. Visit http://codex.wordpress.org/Post_Thumbnails for documentation for thumbnails
$args = array(
'post_type' => 'os_calendar',
'taxonomy' => 'formula1',
'post_per_page' => 5
);
$query = new WP_Query( $args );
Thread Starter
maraki
(@neodjandre)
ok that looks good but i probably need some more help as i am getting confused with the image placement!
Thread Starter
maraki
(@neodjandre)
<?php
$args = array(
'post_type' => 'os_calendar',
'taxonomy' => 'calendar_event_type',
'post_per_page' => 5);
$recentPosts = new WP_Query( $args );
$recentPosts->query('showposts=5');
while ($recentPosts->have_posts()) : $recentPosts->the_post();
?>
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
</div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
I came up with the above to start with but for some reason i am getting blank results 🙁
You don’t need this line at all:
$recentPosts->query('showposts=5');
You have already limited the posts to 5 in the args.
You may want to look at the taxonomy section again in the codex. Are you looking for a specific term from that taxonomy?
To get the post thumbnail at your custom size:
<?php echo get_the_post_thumbnail( $post->ID, 'spotlight' ); ?>
Hope that helps a little.
Thread Starter
maraki
(@neodjandre)
Yes it does.. I also got this reply from my theme editor which i think messes up my code..
Yes, the pre_get_posts filter that is used in functions/custom.php lines 23 – 40 alters the query. You should add suppress_filters to your query.