wordpress在帖子标题下方添加特色图片

我尝试在博客文章标题下方显示特色图片。实际上我的帖子看起来像:

WP-header
post-title
date | author | comments
post content
tag | category 

我的目标是在标题和日期之间获得完整尺寸的图像(特征图像)。作者|评论实际上我正在使用Corpo主题。

有任何想法吗?

最好的祝福


#1


你可以使用以下代码获取特色图片, 并将其粘贴到标题为<?php the_title()?>的标题之后

<?php 
 if ( has_post_thumbnail()) {
   $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
   echo '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" >';
   the_post_thumbnail('thumbnail');
   echo '</a>';
 }
 ?>

由于我还没有看到完整的代码, 因此我可以帮助你。

参见法典教程

来源:

https://www.srcmini02.com/67597.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_36859.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?