在原始循环内显示DESC中的自定义分类标准
问题描述:
我遇到问题。我希望这个循环的帖子以降序显示。但对于一个插件,我必须坚持原始循环。所以我不能使用新的WP_Query或query_posts,因为这会覆盖原始循环。在原始循环内显示DESC中的自定义分类标准
这是我的循环。
<div id="main-filter">
<!-- Start the Loop. -->
<?php if (have_posts()) : while (have_posts()) : the_post();
?>
<!-- Test if the current post is in category 3. -->
<!-- If it is, the div box is given the CSS class "post-cat-three". -->
<!-- Otherwise, the div box is given the CSS class "post". -->
<?php if (in_category('3')) : ?>
<div class="post-cat-three">
<?php else : ?>
<div class="post post-item">
<?php endif; ?>
<!-- Display the Title as a link to the Post's permalink. -->
<div class="ref-wrap">
<div class="col-sm-2 thumb-mobile">
<?php the_post_thumbnail(array(200,200)); // Declare pixel size you need inside the array ?>
</div>
<div class="col-sm-10">
<div class="entry">
<?php $bedrijf = get_field('naam_bedrijf'); ?>
<?php $feest = get_field('feest'); ?>
<?php $geschreven = get_field('geschreven_door'); ?>
<?php $datum = get_field('datum_referentie'); ?>
<?php $tekst = get_field('volledige_tekst'); ?>
<?php $link = get_field('mylink'); ?>
<?php echo '<p>Bedrijfsnaam: ' . $bedrijf . '</p>'; ?>
<?php $post_object = get_field('mylink');
if($post_object): $post = $post_object; setup_postdata($post); ?>
<p>Feest type: <a style="color:#ff6600" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
<?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?>
<?php endif; ?>
<?php echo '<p>Naam: ' . $geschreven . '</p>'; ?>
<?php echo '<p>Datum: ' . $datum . '</p>'; ?>
<?php echo '<p class="mobile-j">' . $tekst . '</p>'; ?>
<?php echo '<p>' . wp_review_show_total() . '</p>'; ?>
</div>
</div>
</div>
<div style="clear:both;"></div>
<!-- Display a comma separated list of the Post's Categories. -->
</div> <!-- closes the first div box -->
<!-- Stop The Loop (but note the "else:" - see next line). -->
<?php endwhile; else : ?>
<!-- The very first "if" tested to see if there were any Posts to -->
<!-- display. This "else" part tells what do if there weren't any. -->
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<!-- REALLY stop The Loop. -->
<?php endif; ?>
<?php wp_pagenavi(); ?>
</div>
是否有无论如何我可以在DESC中订购此循环?
**小编辑:我不知道这个事情,但是这是自定义分类:referentie_type
答
你可以把一切都放在一个阵列,而不是通过数组中的反向,只输出,然后循环然后输出它。
你的约束使得这非常不可能完成。
谢谢。你能否以正确的方式指出我的意思?我曾以为我不得不使用数组。这是否需要某种形式的$ args? 我知道这个插件给了我一些限制。 – Steggie