我正在嘗試更改Wordpress網站中的徽標。 我選擇在媒體部分上傳,並上傳圖像 它在從那裏訪問路徑時正在工作。在WordPress的網站中錯誤的InnerHTML路徑(更改徽標)
但是,如果我訪問該網站的圖像不顯示。 如果我檢查元素的圖像,它顯示路徑是錯誤的: 爲什麼src路徑沒有:?我該如何解決這個問題?
<a class="fusion-logo-link" href="http://localhost:8888/mysite">
<img src="http://localhost8888/mysite/wp-content/uploads/logo.png" width="150" height="157" alt="my site" class="fusion-logo-1x fusion-standard-logo">
在屬性
host: "localhost:8888"
hostname: "localhost"
href: "http://localhost:8888/mysite"
hreflang: ""
id: ""
innerHTML: "↵ ↵ ↵ <img src="http://localhost8888/mysite/wp-content/uploads/logo.png" width="150" height="157" alt="my site" class="fusion-logo-1x fusion-standard-logo">↵ <img src="http://localhost8888/mysite/wp-content/uploads/logo.png" width="150" height="157" alt="my site" style="max-height: 157px; height: auto;" class="fusion-standard-logo fusion-logo-2x">↵ ↵ <!-- mobile logo -->↵ ↵ <!-- sticky header logo -->↵ "
innerText: ""
編輯:
var $standard_logo_height = jQuery('.fusion-standard-logo').height() + parseInt(jQuery('.fusion-logo').data('margin-top')) + parseInt(jQuery('.fusion-logo').data('margin-bottom'));
window.$initial_desktop_header_height = Math.max(window.$header_height, Math.max($menu_height + $menu_border_height, $standard_logo_height) + parseInt(jQuery('.fusion-header').find('.fusion-row').css('padding-top')) + parseInt(jQuery('.fusion-header').find('.fusion-row').css('padding-bottom')));
window.$sticky_can_be_shrinked = true;
if(js_local_vars.sticky_header_shrinkage == '0') {
$animation_duration = 0;
window.$scrolled_header_height = window.$header_height;
}
if ($logo) {
// Getting the correct natural height of the visible logo
if ($logo.hasClass('fusion-logo-2x')) {
var $logo_image = new Image();
$logo_image.src = $logo('src');
window.original_logo_height = parseInt($logo.height()) + parseInt(js_local_vars.logo_margin_top) + parseInt(js_local_vars.logo_margin_bottom);
} else {
// For normal logo we need to setup the image object to get the natural heights
var $logo_image = new Image();
$logo_image.src = $logo('src');
window.original_logo_height = parseInt($logo_image.naturalHeight) + parseInt(js_local_vars.logo_margin_top) + parseInt(js_local_vars.logo_margin_bottom);
// IE8, Opera fallback
$logo_image.onload = function() {
window.original_logo_height = parseInt(this.height) + parseInt(js_local_vars.logo_margin_top) + parseInt(js_local_vars.logo_margin_bottom);
};
}
}
的PHP
<?php if (Avada()->settings->get('logo')) : ?>
<a class="fusion-logo-link" href="<?php echo home_url(); ?>">
<?php $logo_url = Avada_Sanitize::get_url_with_correct_scheme(Avada()->settings->get('logo')); ?>
<?php if (Avada()->settings->get('retina_logo_width') && Avada()->settings->get('retina_logo_height')) : ?>
<?php $logo_size['width'] = Avada()->settings->get('retina_logo_width'); ?>
<?php $logo_size['height'] = Avada()->settings->get('retina_logo_height'); ?>
<?php else : ?>
<?php $logo_size['width'] = ''; ?>
<?php $logo_size['height'] = ''; ?>
<?php endif; ?>
<img src="<?php echo $logo_url; ?>" width="<?php echo $logo_size['width']; ?>" height="<?php echo $logo_size['height']; ?>" alt="<?php bloginfo('name'); ?>" class="fusion-logo-1x fusion-standard-logo" />
<?php $retina_logo = Avada()->settings->get('logo_retina'); ?>
<?php if ($retina_logo) : ?>
<?php $retina_logo = Avada_Sanitize::get_url_with_correct_scheme($retina_logo); ?>
<?php $style = 'style="max-height: ' . $logo_size['height'] . 'px; height: auto;"'; ?>
<img src="<?php echo $retina_logo; ?>" width="<?php echo $logo_size['width']; ?>" height="<?php echo $logo_size['height']; ?>" alt="<?php bloginfo('name'); ?>" <?php echo $style; ?> class="fusion-standard-logo fusion-logo-2x" />
<?php else: ?>
<img src="<?php echo $logo_url; ?>" width="<?php echo $logo_size['width']; ?>" height="<?php echo $logo_size['height']; ?>" alt="<?php bloginfo('name'); ?>" class="fusion-standard-logo fusion-logo-2x" />
<?php endif; ?>
與PHP的請款是指您的標誌進行更新。 – Saedawke
我編輯我的問題 – PoolHallJunkie
我包括PHP部分 – PoolHallJunkie