【发布时间】:2013-07-17 04:52:50
【问题描述】:
我正在开发一个使用 21 个 wordpress 主题的博客。我想在帖子内容左侧显示帖子左侧的缩略图。我在编辑帖子部分使用了设置的特色图像,但尚未成功显示缩略图。
等待帮助。
感谢您的建议
【问题讨论】:
标签: wordpress thumbnails
我正在开发一个使用 21 个 wordpress 主题的博客。我想在帖子内容左侧显示帖子左侧的缩略图。我在编辑帖子部分使用了设置的特色图像,但尚未成功显示缩略图。
等待帮助。
感谢您的建议
【问题讨论】:
标签: wordpress thumbnails
打开二十一点 content.php
找到这个代码:
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
改成:
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php the_post_thumbnail();?>/*Will enable post thumbnails*/
<header class="entry-header">
你已经完成了......
【讨论】:
您可以尝试以下方法:
设置合适的缩略图大小: http://codex.wordpress.org/Function_Reference/add_image_size
添加到 content.php,例如之前,或者您可以将它添加到正文之前的内容,任何适合您的方式
调整 style.css 以允许 header 和 post 元数据环绕图像,您可以使用一些想法
.home .attachment-post-thumbnail { 浮动:左;保证金权利:4%;边距顶部:15px; } .home h1.entry-title { 明确:无; } .home .entry-meta { 明确:无; } .home .entry-content { 明确:两者; }
希望有帮助!
【讨论】: