Display wordpress posts in ascending order
It's ok but,
$wp_query->query('showposts=24&post_type=movie&order=ASC' . '&paged=' . $paged);
The difference is: "order", not "orderby".
Show newest post in ASC order in wordpress
I think this works:
<?php
$myposts = get_posts('cat=3&showposts=3');
if ($myposts) {
$uc=array();
foreach ($myposts as $mypost) {
$uc[]=$mypost->ID;
}
}
$args=array(
'post__in' => $uc,
'orderby' => 'post_date',
'order' => 'ASC',
'posts_per_page' => 3,
'caller_get_posts' => 1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo 'Category 3, lastest posts, sorted oldest to newest';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><small><?php the_time('m.d.y') ?> </small><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
} //if ($my_query)
wp_reset_query(); // Restore global post data stomped by the_post().
?>
Related Topics
Difference Between Settimeout with and Without Quotes and Parentheses
Can't Bind to 'Ngmodel' Since It Isn't a Known Property of 'Input'
Change Url Parameters and Specify Defaults Using JavaScript
How to Get Character Array from a String
How to Call a JavaScript Function on Page Load
Define Global Variable with Webpack
Parse Error: Adjacent Jsx Elements Must Be Wrapped in an Enclosing Tag
JavaScript Global Event Mechanism
JavaScript Unit Test Tools for Tdd
Two Sets of Parentheses After Function Call
How Is Almost Everything in JavaScript an Object
What Is the Meaning of "$" Sign in JavaScript
Why Shouldn't Jsx Props Use Arrow Functions or Bind
How to Get Unique Values in an Array