【发布时间】:2017-04-26 14:51:58
【问题描述】:
我是 wordpress 的新手,我正在尝试更改代码,以便我可以获取图像源,以便我可以在 css 中使用它作为背景,但它会生成图像
这是已经写在 funtions.php 中的代码
$string .= '<p class="recent-image"><a href="' . get_the_permalink() .'">' . get_the_post_thumbnail($post_id, array( 700, 500) ) .'</a></p></div>';
在查看了很多关于此的帖子后,我发现我只能通过以下代码获取图片网址
$string .= '<p class="recent-image"><a href="' . get_the_permalink() .'">' . wp_get_attachment_image_src() .'</a></p></div>';
在我的代码wp_get_attachment_image_src() 中更新此代码,但结果中没有生成任何内容。
有人可以建议我应该尝试什么吗?
【问题讨论】:
标签: php html wordpress wordpress-theming