좋아요, 아마도 제가 생각하기에 아마도 지난 50 개의 게시물에 대해 이렇게하는 것입니다. 지난 n
게시물을 통해
루프, 각 게시물에 대한 각 태그의 term_id
를 추출, 다음 wp_tag_cloud()
의 include
인수에 그 문자열을 전달;
$how_many_posts = 50;
$args = array(
'posts_per_page' => $how_many_posts,
'orderby' => 'date',
'order' => 'DESC',
);
// get the last $how_many_posts, which we will loop over
// and gather the tags of
query_posts($args);
//
$temp_ids = array();
while (have_posts()) : the_post();
// get tags for each post
$posttags = get_the_tags();
if ($posttags) {
foreach($posttags as $tag) {
// store each tag id value
$temp_ids[] = $tag->term_id;
}
}
endwhile;
// we're done with that loop, so we need to reset the query now
wp_reset_query();
$id_string = implode(',', array_unique($temp_ids));
// These are the params I use, you'll want to adjust the args
// to suit the look you want
$args = array(
'smallest' => 10,
'largest' => 30,
'unit' => 'px',
'number' => 150,
'format' => 'flat',
'separator' => "\n",
'orderby' => 'count',
'order' => 'DESC',
'include' => $id_string, // only include stored ids
'link' => 'view',
'echo' => true,
);
wp_tag_cloud($args);
실제로는 타임 스탬프가 없습니다. 그러나 그들은 게시물과 관련이 있고 게시물에는 타임 스탬프가 있기 때문에 타임 스탬프를 검색 할 수 있어야한다고 생각했습니다. 당신의 대답은 나를 생각하게했다. 태그에 타임 스탬프 테이블을 추가하는 것이 가장 쉽지 않을까요? – Nordin