-2
게시물에 여러 추천 이미지가 있으며 모두의 설명이나 루프의 모든 제목이 필요합니다.Wordpress에서 여러 게시물 미리보기 이미지 제목 또는 설명 가져 오기
게시물에 여러 추천 이미지가 있으며 모두의 설명이나 루프의 모든 제목이 필요합니다.Wordpress에서 여러 게시물 미리보기 이미지 제목 또는 설명 가져 오기
기능은 다음
/**
* Retrieve Post Thumbnail Description.
*
* @param string $post_type The post type.
* @param string $id The id used to register the thumbnail.
* @param int $post_id Post ID.
* @return string
*/
public static function the_post_thumbnail_description($post_type, $id, $post_id) {
$post_id = (NULL === $post_id) ? get_the_ID() : $post_id;
$postThumbnailID = get_post_meta($post_id, "{$post_type}_{$id}_thumbnail_id", true);
$description = get_post($postThumbnailID)->post_content;
echo $description;
}
이 기능
MultiPostThumbnails::the_post_thumbnail_description(get_post_type(), 'feature-image-'.$i.'', Null).'<br>';
에게 호출하는 성명 설명을 얻을 수