I've created a custom post type to do hand-crafted excerpts from my blog on my portfolio site. I've got a content window, a link, and a featured image for the post type, which I have called blog.
The issue is that, no matter what I try, the posts are displayed oldest to newest, whereas I would like to display the newest first. Here's the query_posts() call:
<?php query_posts( 'post_type=blog&order=ASC'); ?>
But I've also tried more elaborate queries such as:
<?php query_posts(array('post_type' => 'blog', 'orderby'=>'date','order'=>'ASC')); ?>
My complete template file looks like: ` ">
<div class="sliderContent">
<!--first loop-->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(__('Read More »', THEMENAME)); ?>
<?php endwhile; else: ?>
<p><?php _e('Nothing found.', THEMENAME); ?></p>
<?php endif; ?>
<!--second loop, displays custom post type-->
<?php query_posts(array('post_type' => 'blog', 'orderby'=>'date','order'=>'ASC') ); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="contenttile">
<p><a href="<?php echo get_post_meta($post->ID, 'Permalink', true); ?>"><?php the_post_thumbnail('medium'); ?></a></p>
<h2><?php the_title(); ?></h2>
<?php the_content(__('Read More »', THEMENAME)); ?>
</div>
<?php endwhile; else: ?>
<p><?php _e('Nothing found.', THEMENAME); ?></p>
<?php endif; ?>
</div>
</div>
<!-- content end -->
<?php } ?>
`
So I'm displaying the content from the page that this template is applied, then I'm displaying my custom post type.
Thanks for the help, I'm stumped!
query_posts()ignores every part of the query butpost_type? Is that possible? - catdotgif