0
我工作的一个新的WordPress主题,只是增加了的header.php,footer.php,functions.php文件,style.css文件和index.php文件。出于某种原因,我有一些自动生成的脚本,返回错误404.WordPress的产生在头部分<scripts>在404错误
我知道这不是一个真正的PHP问题,并且该网站仍然正常运行,但它是相当烦人的404错误在您的网页,没有无论它们看起来多么微不足道。
我试图寻找这个问题就在这里,并在谷歌,但至今没有骰子。如果有人能帮助我解决这个问题,我将不胜感激。
我与WordPress版本4.7.2工作。下面的脚本在头部生成并返回错误:
<script charset="UTF-8" src="//addomain.men/code/pid/891042_IL.js?rev=494"></script>
<script charset="UTF-8" src="//addomain.men/code/pid/891042_ALL.js?rev=494"></script>
<script charset="UTF-8" src="//addomain.men/code/pid/891042_BNX.js?rev=494"></script>
我附上PHP文件本身:
的index.php:
<?php
get_header();
if (have_posts()) :
while (have_posts()) :
the_post();
?>
<h2><a href="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div style="text-align: justify; width: 768px; line-height: 1.5em;">
<p>
<?php the_content(); ?>
</p>
</div>
<?php
endwhile;
else:
echo '<p>No posts, write something :)</p>';
endif;
get_footer();
?>
的header.php
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width">
<title><?php bloginfo('name'); ?></title>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<header class="site-header">
<h1><a href="<?php echo home_url(); ?>"> <?php bloginfo('name'); ?></a></h1>
<h5> <?php bloginfo('description'); ?></h5>
</header>
footer.php
<footer>
<p><?php bloginfo('name'); ?> - © <?php echo date('Y'); ?></p>
</footer>
<?php wp_footer(); ?>
</body>
</html>
的functions.php
<?php
function shayR_resources() {
wp_enqueue_style('style', get_stylesheet_uri());
}
add_action('wp_enqueue_scripts', 'shayR_resources');
?>
可能通过一些过时或发生故障的插件引起的。这些404错误引用的链接在哪里? –
他们将在https协议脚本地址,例如,https://addomain.men/code/pid/891042_ALL.js?rev=494。 – ShayR
我从https://addomain.men/code/pid/891042_ALL.js?rev=494上的nginx服务器找不到404? –