0
出于某种原因,无论我做什么,似乎都没有工作将这些帖子按字母顺序排列。该代码是:在Wordpress中按姓名排序
<?php if (have_posts()) : while (have_posts()) : the_post();
array('posts_per_page' => -1, 'orderby'=> 'title', 'order' => 'ASC');
?>
<li>
<div class="sponsor-thumb">
<a href="'.get_permalink().'">
<?php the_post_thumbnail('category-thumb'); ?></a></div>
<a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a></li>
<?php endwhile; else: ?>
<p><?php _e('Sorry, this page does not exist.'); ?></p>
<?php endif; ?>
难道我把它这样吗? <?php $ args = array('posts_per_page'=> -1,'orderby'=>'title','order'=>'ASC'); $ my_query = new WP_Query($ args); 如果($ my_query-> have_posts()): 而($ my_query-> have_posts()):$ my_query-> the_post(); //在这里做点东西 endwhile; endif; ?> – user3181828
是的,它将需要去PHP标签 – BIOSTALL
我有一个插件被激活,通过拖放排序的帖子。花了我几个小时才明白。烦人。 谢谢你的贡献。 – user3181828