2015-12-22 36 views
0

試圖獲得下一篇文章url,自定義文章類型是投資組合。已在此帖子類型的帖子中添加標籤。 「星」。獲取下一篇文章相同標籤的時間WordPress

我試圖按時間獲取下一篇文章的網址。並且應該有相同的標籤。

有人知道怎麼可能得到那個。

回答

0

我發現,代碼是能夠得到

$args=array(
    'portfolio-tag' => 'loop1', 
    'showposts'=>5, 
    'caller_get_posts'=>1 
); 
$my_query = new WP_Query($args); 
if($my_query->have_posts()) { 
    echo '5 recent Posts with tag1'; 
    while ($my_query->have_posts()) : $my_query->the_post(); ?> 
    <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> 
    <?php 
    endwhile; 
} 

但我需要的URL只是爲了接下來的文章按時間,如果我在第四細節後,我怎麼能得到5帖子的網址。所以它將成爲這個集合中的下一個。

相關問題