每个职位目前都需要featured image
在帖子中重复多次。
是否有任何方法可以动态调用featured image
返回到帖子中,而不是手动多次插入图像?
UPDATE
我还希望能够显示图像的caption
和permalink
如果可能的话。每个职位目前都需要featured image
在帖子中重复多次。
是否有任何方法可以动态调用featured image
返回到帖子中,而不是手动多次插入图像?
UPDATE
我还希望能够显示图像的caption
和permalink
如果可能的话。注册shortcode, 理想的插件或函数。php,如果必须的话。
add_shortcode(\'thumbnail\', \'thumbnail_in_content\');
function thumbnail_in_content($atts) {
global $post;
return get_the_post_thumbnail($post->ID);
}
添加shortcode 向您发布内容。[thumbnail]
如果需要更多功能,请参阅this post 或者pastebin.<小时>
ADDING CAPTIONS AND LINKS
add_shortcode(\'thumbnail\', \'thumbnail_with_caption_shortcode\');
function thumbnail_with_caption_shortcode($atts) {
global $post;
// Image to display
$thumbnail = get_the_post_thumbnail($post->ID);
// ID of featured image
$thumbnail_id = get_post_thumbnail_id();
// Caption from featured image\'s WP_Post
$caption = get_post($thumbnail_id)->post_excerpt;
// Link to attachment page
$link = get_permalink($thumbnail_id);
// Final output
return \'<div class="featured-image">\'
. \'<a href="\' . $link . \'">\'
. $thumbnail
. \'<span class="caption">\' . $caption . \'</span>\'
. \'</a>\'
. \'</div>\';
}
RESOURCES
将Wordpress移动到另一个帐户后,样式和图像将被破坏。我曾尝试禁用插件,检查并更新“插件”;上载“;数据库中的文件夹,检查文件夹和文件权限,重新保存永久链接,将代码添加到wp配置。。。没有人修复此问题。此处截图:https://prnt.sc/v9mxqt有什么建议吗谢谢