簡體   English   中英

錯誤:雜散末端標簽頭

[英]Error: Stray end tag head

我很想解決Stray結束標簽頭的問題。

<!doctype html>
<html <?php language_attributes(); ?> >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="X-FRAME-OPTIONS" content="ALLOW-FROM" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>
<?php wp_title("|",true, 'right'); ?>
<?php if (!defined('WPSEO_VERSION')) { bloginfo('name'); } ?>
</title>
<link rel='shortcut icon' href='<?php echo get_template_directory_uri(); ?>/img/favicon.ico' type='image/x-icon' />
<?php 
$page_amp_url = get_post_meta(get_the_ID(), 'amp_page_url', TRUE);
if(!empty($page_amp_url)){ 
echo'<link rel="amphtml" href="'.$page_amp_url.'" />';
}
?>
<?php $options = get_option('salient'); ?>
<?php if(!empty($options['responsive']) && $options['responsive'] == 1) { ?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
<?php } else { ?>
<meta name="viewport" content="width=1200" />
<?php } ?>
<!--Shortcut icon-->
<?php if(!empty($options['favicon'])) { ?>
<link rel="shortcut icon" href="<?php echo nectar_options_img($options['favicon']); ?>" />
<?php } ?>
<?php  if(is_page('5584')){ ?>
<meta property="og:image" content="https://www.accudock.com/wp-content/uploads/2016/11/willy-375x376-375x376.jpg" />
<meta property="og:image:width" content="375" />
<meta property="og:image:height" content="376" />
<meta property="og:image" content="https://www.accudock.com/wp-content/uploads/2016/11/willy1-375x376.jpg" />
<meta property="og:image:width" content="375" />
<meta property="og:image:height" content="376" />
<meta property="og:image" content="https://www.accudock.com/wp-content/uploads/2016/11/Untitled-1-375x376.jpg" />
<meta property="og:image:width" content="375" />
<meta property="og:image:height" content="376" />
<meta property="og:image" content="https://www.accudock.com/wp-content/uploads/2016/11/4x20-floating-dock-375x376.jpg" />
<meta property="og:image:width" content="375" />
<meta property="og:image:height" content="376" />
<?php }?>
<?php wp_head(); ?>
<?php
global $post; 
global $woocommerce; 
//check if parallax nectar slider is being used
$parallax_nectar_slider = using_nectar_slider();

$force_effect = get_post_meta($post->ID, '_force_transparent_header', true);

// header transparent option

$transparency_markup = null;

$activate_transparency = null;

$using_fw_slider = using_nectar_slider();

$using_fw_slider = (!empty($options['transparent-header']) && $options['transparent-header'] == '1') ? $using_fw_slider : 0;

if($force_effect == 'on') $using_fw_slider = '1';


$disable_effect = get_post_meta($post->ID, '_disable_transparent_header', true);

if(!empty($options['transparent-header']) && $options['transparent-header'] == '1') {



$starting_color = (empty($options['header-starting-color'])) ? '#ffffff' : $options['header-starting-color'];

$activate_transparency = using_page_header($post->ID);

$remove_border = (!empty($options['header-remove-border']) && $options['header-remove-border'] == '1') ? 'true' : 'false';

$transparency_markup = ($activate_transparency == 'true') ? 'data-transparent-header="true" data-remove-border="'.$remove_border.'" class="transparent"' : null ;

}

//header vars

$logo_class = (!empty($options['use-logo']) && $options['use-logo'] == '1') ? null : 'class="no-image"'; 

$sideWidgetArea = (!empty($options['header-slide-out-widget-area'])) ? $options['header-slide-out-widget-area'] : 'off';

$sideWidgetClass = (!empty($options['header-slide-out-widget-area-style'])) ? $options['header-slide-out-widget-area-style'] : 'slide-out-from-right';

$fullWidthHeader = (!empty($options['header-fullwidth']) && $options['header-fullwidth'] == '1') ? 'true' : 'false';

$headerSearch = (!empty($options['header-disable-search']) && $options['header-disable-search'] == '1') ? 'false' : 'true';

$headerFormat = (!empty($options['header_format'])) ? $options['header_format'] : 'default';

$mobile_fixed = (!empty($options['header-mobile-fixed'])) ? $options['header-mobile-fixed'] : 'false';

$fullWidthHeader = (!empty($options['header-fullwidth']) && $options['header-fullwidth'] == '1') ? 'true' : 'false';

$headerColorScheme = (!empty($options['header-color'])) ? $options['header-color'] : 'light';

$userSetBG = (!empty($options['header-background-color']) && $headerColorScheme == 'custom') ? $options['header-background-color'] : '#ffffff';

$trans_header = (!empty($options['transparent-header']) && $options['transparent-header'] == '1') ? $options['transparent-header'] : 'false';

$bg_header = (!empty($post->ID) && $post->ID != 0) ? using_page_header($post->ID) : 0;

$bg_header = ($bg_header == 1) ? 'true' : 'false'; //convert to string for references in css

$perm_trans = (!empty($options['header-permanent-transparent']) && $trans_header != 'false' && $bg_header == 'true') ? $options['header-permanent-transparent'] : 'false'; 

$headerResize = (!empty($options['header-resize-on-scroll']) && $perm_trans != '1') ? $options['header-resize-on-scroll'] : '0'; 

$button_styling = (!empty($options['button-styling'])) ? $options['button-styling'] : 'default'; 

$footer_reveal = (!empty($options['footer-reveal'])) ? $options['footer-reveal'] : 'false'; 

$footer_reveal_shadow = (!empty($options['footer-reveal-shadow']) && $footer_reveal == '1') ? $options['footer-reveal-shadow'] : 'none'; 

$has_main_menu = (has_nav_menu('top_nav')) ? 'true' : 'false';

if($headerColorScheme == 'dark') { $userSetBG = '#1f1f1f'; }    

$userSetSideWidgetArea = $sideWidgetArea;

if($has_main_menu == 'true' && $mobile_fixed == '1') $sideWidgetArea = '1';

if($headerFormat == 'centered-menu-under-logo') $fullWidthHeader = 'false';

?>
</head>

通常,主題標題是自定義的。 在該代碼中我看不到任何問題。 請指導我如何解決此問題。

這是w3c驗證

您的html中有一些注釋錯誤。

首先在這里:(這是更正的代碼)

<!-- [if IE 8]--> <link rel="stylesheet" type="text/css" href="https://www.accudock.com/wp-content/plugins/js_composer_salient/assets/css/vc-ie8.css" media="screen"> <!--[endif]--> <!-- BEGIN recaptcha, injected by plugin wp-recaptcha-integration --> <!-- END recaptcha --> <!-- WP Facebook Pixel Code - Main -->

接下來,從此處的<noscript>標記中刪除<img>標記:

<noscript><img alt="" height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=638313929660068&ev=PageView&noscript=1" /></noscript>

這將解決流浪頭標簽錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM