php - 在其他 div 中显示图像 - wordpress

标签 php html css wordpress

<分区>


想改进这个问题吗? 通过 editing this post 添加细节并澄清问题.

关闭 9 年前

我想在其他 div 中显示帖子的图像,然后在内容的 div 中显示。

我的意思是这样的。

<div class="latest-posts">
    <div class="latest-posts-info">
        <div class="title"><h1>HERE IS TITLE<h1></div>
        <div class="text">HERE IS CONTENT</div>
        <a href="#" class="read-more">Read more...</a>
        <div class="clear"></div>
    </div>
    <div class="latest-posts-img">HERE I WANT THE IMAGE</div>
    <div class="clear"></div>
</div>

在 wp admin 中添加帖子时,我注意到这是唯一的方法,即在内容中显示图像。

谢谢

最佳答案

查看此页面:http://codex.wordpress.org/Function_Reference/the_post_thumbnail

<div class="latest-posts-img"> <?php the_post_thumbnail( $size, $attr ); ?> </div>

关于php - 在其他 div 中显示图像 - wordpress,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18483906/

上一篇:html - Bootstrap 跨度不是内联的

下一篇:jquery - 通过鼠标滚轮滚动 overflow-x

相关文章:

php - Laravel/Lumen 关系 - 加入条件检索错误的其他表

javascript - 未捕获的语法错误 : Unexpected token< VM3419:1

php - SSL 保护的 PDO 连接不起作用 - SQLSTATE SSL 错误 - 用户访问被拒绝(使用密码 : YES)

php - 拉推特头像

javascript - 如何计算印地语中的单词数

javascript - 为什么一个 div 会影响另一个 div?

php - 如何以编程方式输出 Drupal 节点链接的自定义路径(无 PathAuto)?

html - CSS 在保持宽高比的同时用子元素填充容器 div(与背景大小 : contain) 一样

html - 有没有办法在 HTML 中实现 6 点按钮?

jquery - 如何在用户使用 JQuery 在单选按钮上进行选择时应用和/或删除 CSS 类?