2013-10-03 36 views
3

我可以使用:WordPress的(WordPress的熱門職位插件)查詢

<?php 
if (function_exists('wpp_get_mostpopular')) { 
    wpp_get_mostpopular('range=weekly&order_by=views&limit=8'); 
} 
?> 

裏面的自定義模板(查詢職位內),使查詢與自己的模板輸出:

<?php query_posts(????????); ?> 
<?php while (have_posts()) : the_post(); ?> 
<div class="myclass"> 
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php echo get_the_post_thumbnail($post_id, 'thumbnail'); ?></a> 
</div> 

請幫我這個,所以我不必編輯插件和插件的CSS,而只需通過此插件查詢帖子即可。

謝謝。

插件:http://wordpress.org/plugins/wordpress-popular-posts/

回答

0

@alen IMEKO只要我有understoody您的需求量的,你爲什麼需要這個插件,你只需要展示最流行的帖子在任何你需要,你只需要設置發帖粘貼並使用相同的查詢帖子方法調用粘貼帖子,然後它會自動在相應的地方呈現您指定的帖子。 對於這只是發佈,使其粘貼,發佈/更新按鈕上方的頂部,你會看到一個選項知名度點擊它的編輯部分,你會選擇將滑下來選中複選框有文字棒這篇文章到首頁之後,你只需要執行查詢。

 

     $args = array( 
    'post__in' => get_option('sticky_posts'), 
    'posts_per_page' => 20, 
    'orderby' => 'title', 
    'post_date' => 'DESC', 
    'cat' => your category id 
    ); 

    query_post($args); 
?> 

然後你需要簡單地使用while循環,就像你在wordpress中做的那樣。