我在wordpress主题中具有以下行代码,并且我只希望显示4或5个帖子。我必须添加什么?
<div class="mvp-feat1-list-head-wrap left relative">
<ul class="mvp-feat1-list-buts left relative">
<li class="mvp-feat-col-tab"><a href="#mvp-feat-tab-col1"><span class="mvp-feat1-list-but"><?php esc_html_e( 'Latest', 'zox-news' ); ?></span></a></li>
<?php query_posts(array( 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-video' )) )); if (have_posts()) : ?>
<li><a href="#mvp-feat-tab-col2"><span class="mvp-feat1-list-but"><?php esc_html_e( 'Videos', 'zox-news' ); ?></span></a></li>
<?php endif; wp_reset_query(); ?>
<?php query_posts(array( 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-gallery' )) )); if (have_posts()) : ?>
<li><a href="#mvp-feat-tab-col3"><span class="mvp-feat1-list-but"><?php esc_html_e( 'Galleries', 'zox-news' ); ?></span></a></li>
<?php endif; wp_reset_query(); ?>
</ul>
</div>
答案 0 :(得分:2)
通过more detailed here explanation is here数组中的@Override
protected void attachView() {
// Get the fragment from dagger
getFragmentManager().
beginTransaction().
setCustomAnimations(R.animator.slide_up, 0, 0, R.animator.slide_down).
replace(R.id.contentFrame1, new MatchFragment2()).
addToBackStack("MatchFragment").
commit();
getFragmentManager().executePendingTransactions();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
getFragmentManager().
beginTransaction().
setCustomAnimations(R.animator.slide_up, 0, 0, R.animator.slide_down).
replace(R.id.contentFrame1, new VictorFragment()).
addToBackStack("VictorFragment").
commit();
getFragmentManager().executePendingTransactions();
getFragmentManager().getBackStackEntryCount(); //this reads 2
}
}, 3000);
}
'posts_per_page' => 2