2012-09-06 16 views
1

我試圖編輯Wordpress主題的主題模板:http://demo.fabthemes.com/financio/ 在「從博客」容器中,我不想顯示所有最新條目。 由於我在我的學習路徑,我不需要一個確切的解決方案。我只是需要有人指點我正確的方向。如何更改在jQuery滑塊中排序的標準?

問題: 如何更改我的代碼,以便滑塊將顯示來自特定標題的條目? 我覺得自己需要改變某些事情在

"$the_query->have_posts()) : $the_query->the_post();"

<div id="timer1" class="timer"></div> 
<div id="carslide"> 
    <?php $the_query = new WP_Query('posts_per_page=9'); 
    while ($the_query->have_posts()) : $the_query->the_post(); ?> 
<div class="post slidepost" id="post-<?php the_ID(); ?>"> 
    <?php 
     $thumb = get_post_thumbnail_id(); 
     $img_url = wp_get_attachment_url($thumb,'full'); //get full URL to image (use "large" or "medium" if the images too big) 
     $image = aq_resize($img_url, 300, 150, true); //resize & crop the image 
    ?> 
<?php if($image) : ?> 
    <a href="<?php the_permalink(); ?>"> 
    <img class="slide-image" src="<?php echo $image ?>"/> 
    </a> 
<?php endif; ?> 
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2> 
    <?php wpe_excerpt('wpe_excerptlength_index', 'wpe_excerptmore'); ?> 
    <div class="clear"> 
</div> 

+0

你是什麼意思的「從具體的標題」? – brianpeiris

回答

1

我想你想改變WP_Query('posts_per_page=9')一部分,所以它顯示匹配不同查詢職位。你可以閱讀reference for queries瞭解更多信息。

例如,如果您想顯示特定類別的五個最新帖子,您可以使用WP_Query('posts_per_page=5&cat=3')

+0

這樣做。謝謝 – max