如何动态地将缩略图标题作为WP中的帖子标题?

时间:2012-08-12 11:43:49

标签: php wordpress themes

我现在有一个函数来制作缩略图的大小:

if (function_exists('add_theme_support')) {
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(200,112);
}

我想将title=""的值作为帖子标题。

1 个答案:

答案 0 :(得分:1)

欢迎来到SO。如果这个答案有助于你不要忘记接受它是正确的。

the_post_thumbnail('medium', array('title' => strip_tags(get_the_title())));

echo get_the_post_thumbnail( $post->ID, 'post-thumbnail', array('title' => strip_tags(get_the_title())) );

OBS:“设置缩略图”现在在信息中心中称为“特色图片”

enter image description here

享受它!

相关问题