嗨,我在wordpress中有這個模板,我想顯示10個項目,因爲現在在wordpress中的一般選項我有5個項目,但我想用此模板來例外我不知道我需要修改代碼,以便在該模板顯示10個項目:只顯示自定義模板中的10個項目
<?php
/*
Template Name: Blog List
*/
?>
<?php get_header(); ?>
<div class="content-wrap">
<div class="content">
<?php tie_breadcrumbs() ?>
<div id="content" class="podcast_archive">
<!--<div class="podcast_full">-->
<?php if (have_posts()) : ?>
<header><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<h1><?php _e('El Jurado del Pueblo' , 'ss-podcasting'); ?></h1>
</header>
<?php
$feed_url = trailingslashit(home_url()) . '?feed=podcast';
$custom_feed_url = get_option('ss_podcasting_feed_url');
if($custom_feed_url && strlen($custom_feed_url) > 0 && $custom_feed_url != '') {
$feed_url = $custom_feed_url;
}
$itunes_url = str_replace(array('http:' , 'https:') , 'itpc:' , $feed_url);
?>
<section>
<?php
/* Start the Loop */
while (have_posts()) : the_post(); ?>
<?php
$terms = wp_get_post_terms(get_the_ID() , 'series');
foreach($terms as $term) {
$series_id = $term->term_id;
$series = $term->name;
break;
}
?>
<article class="podcast_episode">
<?php if(has_post_thumbnail()) { ?>
<?php $img = wp_get_attachment_image_src(get_post_thumbnail_id()); ?>
<a>" title="<?php the_title(); ?>">
<?php the_post_thumbnail('podcast-thumbnail' , array('class' => 'podcast_image' , 'alt' => get_the_title() , 'title' => get_the_title())); ?>
</a>
<?php } ?>
<h3>
<strong><?php the_title(); ?></strong>
<div class="podcast_meta"><?php echo $series; ?><aside></div>
</h3>
<div id="audio">
<?php global $ss_podcasting;
$enclosure = $ss_podcasting->get_enclosure(get_the_ID());
if($enclosure) {
$audio_player = $ss_podcasting->audio_player($enclosure);
echo $audio_player;
} ?>
<?php the_content(); ?>
</div>
<div id="audioinfo">
<a>">Descargar Audio</a>
<span class="audiometa">
Tamaño: <?php echo get_post_meta(get_the_ID(), 'filesize', true) ?>
</span>
</div>
<?php echo do_shortcode('[divider]');?>
</article>
<?php
endwhile;
?>
</section>
<?php endif; ?>
<?php wp_pagenavi(); ?>
<div class="podcast_clear"></div>
</div>
<?php comments_template('', true); ?>
</div><!-- .content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
?>
我會勸一些,所以我可以自己做:) 非常感謝你
行不通的,顯示我的其他類別:(不是模板我有 – alexistkd
遺憾的所有帖子,我沒有意識到這是針對特定的查詢。新的編輯應該保留你原來的查詢,併爲你添加showpost限制 –
真棒,非常感謝你 – alexistkd