未在浏览器标题栏中显示的WordPress标题

问题描述:

网站标题未显示在浏览器标题栏中。未在浏览器标题栏中显示的WordPress标题

我在浏览器中看到过页面源代码,并注意到标签正在重复。这可能是一个问题。我无法找到重复。

这是我的header.php

<!DOCTYPE html> 
<!--[if IE 6]> 
<html id="ie6" <?php language_attributes(); ?>> 
<![endif]--> 
<!--[if IE 7]> 
<html id="ie7" <?php language_attributes(); ?>> 
<![endif]--> 
<!--[if IE 8]> 
<html id="ie8" <?php language_attributes(); ?>> 
<![endif]--> 
<!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!--> 
<html <?php language_attributes(); ?>> 
<!--<![endif]--> 
<head> 
<meta charset="<?php bloginfo('charset'); ?>" /> 
<meta name="viewport" content="width=device-width" /> 

<title><?php 

    global $page, $paged; 

    wp_title('|', true, 'right'); 

    // Add the blog name. 
    bloginfo('name'); 

    // Add the blog description for the home/front page. 
    $site_description = get_bloginfo('description', 'display'); 
    if ($site_description && (is_home() || is_front_page())) 
     echo " | $site_description"; 

    // Add a page number if necessary: 
    if ($paged >= 2 || $page >= 2) 
     echo ' | ' . sprintf(__('Page %s', 'oscar'), max($paged, $page)); 

    ?></title> 
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" /> 
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> 
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'> 

<?php 

    if (is_singular() && get_option('thread_comments')) 
     wp_enqueue_script('comment-reply'); 

    wp_head(); 

?> 

</head> 

<body <?php body_class(); ?>> 
+0

另外我正在调用在index.php中的功能,并且没有或标签。 – Bilal 2012-08-16 07:21:28

问题是,Wordpress试图打印错误或警告消息。但是'WP_DEBUG'WP_CONFIG.PHP中是错误的。 我只是让define('WP_DEBUG', false);define('WP_DEBUG', true);

它显示了一些警告消息。

+0

这仍然没有解释你的双'html'标签 – janw 2012-08-16 08:31:42

看看你的源代码的代码,你有2 doctypeshtmlhead,bodytitle标签。 你需要找出那些来自哪里。 可能在<?php get_header(); ?>部分上方有html标签。

它是你自己的主题吗?

更新
找出停用所有插件的原因。
如果这有助于再次逐个打开它们,看看是哪一个。

如果这没有帮助。关闭fucntions.php(现在重命名)。
如果这无助于我们提供主题中所有(php)文件的列表。

+0

是的,这是我自己的主题。 上面没有html – Bilal 2012-08-16 07:29:13

+0

您是否安装了Yoast? – SMacFadyen 2012-08-16 08:05:15

+0

@SMacFadyen我在源代码中看不到那个问题 – janw 2012-08-16 08:32:26

的原因不能在你的页面显示标题正是这一点 - 有2 冠军标签,并关闭标签的两倍。这意味着,或者某个插件包含每个页面中的内容,或者您​​在PHP中使用自动准备结束文件。在你的“php.ini”配置文件中检查这些行:

; Automatically add files before PHP document. 
; http://php.net/auto-prepend-file 
auto_prepend_file = 

; Automatically add files after PHP document. 
; http://php.net/auto-append-file 
auto_append_file = 
+0

问题是 wp_enqueue_script被称为错误。直到wp_enqueue_scriptsadmin_enqueue_scriptsinit挂钩之前,脚本和样式不应注册或排队。有关更多信息,请参阅Debugging in WordPress。 (这条消息是在3.3版本中添加的。)在C:\ wamp \ www \ wordpress \ wp-includes \ functions.php上2748行 如何解决这个问题? – Bilal 2012-08-16 10:36:07