Posts on homepage order by ID?
-
Hello,
The codes of my home page are like following,
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <div class="posttop"> <img src="/images/get-ringtone.gif" alt="ringtones"> <h1 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark"> <?php the_title(); ?> </a></h1> <div class="clear" style="margin-bottom:15px;"></div> <div class="storycontent"> <?php the_content(__('more...')); ?> <?php } ?>
When visiting homepage, the following SQL are executed,
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 0, 10
I have 100k articles in WordPress, so it’s quite slow to ‘ORDER BY wp_posts.post_date’.
Is there any method to ORDER BY ID?Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Posts on homepage order by ID?’ is closed to new replies.