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? –