这把我逼疯了!我正在使用“Migrate DB“为新服务器导出DB的插件。我有一个双重更改,因为我们正在移动服务器,还有域。
http://thebodywisegym.co.uk -> https://bodywisegym.co.uk
所以我告诉它替换:
当我把它放在新服务器的DB上时,站点在很大程度上可以工作,但是
some 缺少图像:
我可以在管理面板的“媒体”部分看到有问题的媒体,所以我知道图像很好。但是,如果我查看网站上的源代码,我会得到:
<img class="alignleft" src="" alt="Testimonial" title="Ryan Anderson"/>
我确信我做的一切都是对的!我错过什么了吗?我似乎总是很有乐趣和游戏从
http
到
https
以及一条新路径:/
UPDATE: 按照要求,我试着遵循代码-有点漏洞!
这是输出图像的模板中的代码:
<?php mo_thumbnail(array(
\'before_html\' => \'<p>\',
\'after_html\' => \'</p>\',
\'image_size\' => \'square\',
\'image_class\' => \'alignleft\',
\'wrapper\' => false,
\'image_alt\' => \'Testimonial\',
\'size\' => \'full\'
)); ?>
然后,该功能将导致:
function mo_thumbnail($args) {
$thumbnail_element = mo_get_thumbnail($args);
if (!empty($thumbnail_element)) {
echo $thumbnail_element;
return true;
}
return false;
}
。。。该函数如下所示:
function mo_get_thumbnail($args) {
global $mo_theme;
$context = $mo_theme->get_context(\'loop\');
$defaults = array(
\'format\' => \'array\',
\'size\' => \'full\',
\'image_scan\' => false,
\'youtube_scan\' => false,
\'wrapper\' => true,
\'show_image_info\' => false,
\'before_html\' => \'\',
\'after_html\' => \'\',
\'image_class\' => \'thumbnail\',
\'image_alt\' => \'\',
\'image_title\' => \'\',
\'meta_key\' => array(),
\'style_size\' => false,
\'the_post_thumbnail\' => true,
// Keep this true to enable featured posts
\'force_aqua_resizer\' => true,
\'taxonomy\' => \'category\',
\'cache\' => false,
// WordPress handles image caching for you.
);
$args = wp_parse_args($args, $defaults);
/* Extract the array to allow easy use of variables. */
extract($args);
$output = \'\';
if (empty($image_size)) {
$thumbnail_urls = mo_get_original_image_urls($args);
}
else {
//image_size can be an array with height and width key value pairs or a string
if (is_string($image_size)) {
$image_size = mo_get_image_size_array($image_size);
$args[\'force_aqua_resizer\'] = false; // we have the wp sizes taken care of
}
$args[\'height\'] = $image_size[\'height\'];
$args[\'width\'] = $image_size[\'width\'];
$thumbnail_urls = mo_get_thumbnail_urls($args);
}
//create the thumbnail
if (!empty($thumbnail_urls)) {
$thumbnail_src = $thumbnail_urls[0];
$thumbnail_element = $thumbnail_urls[1];
if (empty($post_id))
$post_id = get_the_ID();
$post_title = get_the_title($post_id);
$post_link = get_permalink($post_id);
$post_type = get_post_type($post_id);
$rel_attribute = \'rel="prettyPhoto[\' . $context . \']" \';
if ($post_type === \'gallery_item\') {
// Make the anchor to gallery thumbnail point to the image directly
$before_html = \'<a title="\' . $post_title . \'" href="\' . $thumbnail_src . \' ">\';
$after_html = \'</a>\' . $after_html;
if ($wrapper) {
$wrapper_html = \'<div class="image-area">\';
$before_html = $wrapper_html . $before_html;
if (mo_show_image_info($context) || $show_image_info) {
$image_info = \'<div class="image-overlay"></div>\';
$image_info .= \'<div class="image-info">\';
$image_info .= \'<div class="post-title">\' . $post_title . \'</div>\'; // do not link to post for gallery
$image_info .= mo_get_taxonomy_info($taxonomy);
$image_info .= \'<div class="image-info-buttons">\'; // Make this part of the link itself
$image_info .= \'<a class="lightbox-link button transparent"\' . $rel_attribute . \'title="\' . $post_title . \'" href="\' . $thumbnail_src . \' ">\' . __(\'Expand\', \'mo_theme\') . \'</a>\';
$image_info .= \'</div>\';
$image_info .= \'</div>\';
$after_html .= $image_info;
}
$after_html .= \'</div>\'; // end of image-area
}
}
else {
if (empty($before_html)) {
$before_html = \'<a title="\' . $post_title . \'" href="\' . $post_link . \' ">\';
$after_html = \'</a>\' . $after_html;
}
if ($wrapper) {
$wrapper_html = \'<div class="image-area">\';
$before_html = $wrapper_html . $before_html;
if (mo_show_image_info($context) || $show_image_info) {
$image_info = \'<div class="image-overlay"></div>\';
$image_info .= \'<div class="image-info">\';
$image_info .= \'<div class="post-title"><a title="\' . $post_title . \'" href="\' . $post_link . \' ">\' . $post_title . \'</a></div>\';
$image_info .= mo_get_taxonomy_info($taxonomy);
$image_info .= \'<div class="image-info-buttons">\';
// point me to the source of the image for lightbox preview
$image_info .= \'<a class="lightbox-link button transparent"\' . $rel_attribute . \'title="\' . $post_title . \'" href="\' . $thumbnail_src . \' ">\' . __(\'Expand\', \'mo_theme\') . \'</a>\';
$image_info .= \'<a class="post-link button transparent" href="\' . $post_link . \'" title="\' . $post_title . \'">\' . __(\'Details\', \'mo_theme\') . \'</a>\';
$image_info .= \'</div>\';
$image_info .= \'</div>\';
$after_html .= $image_info;
}
$after_html .= \'</div>\'; // end of image-area
}
}
$output = $before_html;
$output .= $thumbnail_element;
$output .= $after_html;
}
return $output;
}