我正在创建自定义WordPress主题,并且我希望自己创建多个页面。创建第二页后,在我将另一页的模板更改为我创建的新页面之后,主页现在显示为与body标签中的id=error-page
奇怪的中心对齐。所有这些都不会对索引页产生影响。
我已经尝试将index.php复制到home.php,但是索引页面仍然加载了奇怪的中心对齐方式,并且在body标签中包含相同的id=error-page
。该页面最初显示正常,但是在为我尝试创建的新页面添加页面模板后,索引已更改。
这是我的[[index.php中的前几节,显示我的代码应该是正确的:
<?php get_footer(); >
<!-- Background Video -->
<div class="video">
<div class="overlay"></div>
<video playsinline="playsinline" autoplay="autoplay" muted="muted" loop="loop">
<source src="<?php echo get_template_directory_uri(); ?>/videos/FFHPainVideo.mp4" type="video/mp4"/>
</video>
</div>
<!-- Hero Video Text -->
<div class="container h-100">
<div class="d-flex h-100 text-center align-items-center">
<div class="w-100 text-black">
<button type="button" class="btn btn-danger btn-circle btn-xl open"><i class="fa fa-play text-white" aria-hidden="true"></i></button>
<h1 class="display-3">Family First Healthcare</h1>
<h1 class="display-3">Pain Management</h1>
<p class="lead mb-0">An Athens Heart Center & Specialty Clinics Affiliate</p>
<button onclick="window.location.href = '#'; " type="button" class="btn btn-danger mt-3 px-4">Get Started Here ></button>
</div>
</div>
</div>
我希望页面在加载时是正常的,但也会出现Failed to load resource: the server responded with a status of 500. (index):1
错误。以下是最新的服务器日志:
PHP Fatal error: Uncaught Error: Call to >undefined function get_ssite_url() in /srv/htdocs/wp-content/themes/No Phun/footer.php:18 Stack trace: #0 /wordpress/core/5.2.3/wp-includes/template.php(722): require_once() #1 /wordpress/core/5.2.3/wp-includes/template.php(671): load_template('/srv/htdocs/wp-...', true) #2 /wordpress/core/5.2.3/wp-includes/general-template.php(76): locate_template(Array, true) #3 /srv/htdocs/wp-content/themes/No Phun/index.php(218): get_footer() #4 /wordpress/core/5.2.3/wp-includes/template-loader.php(78): include('/srv/htdocs/wp-...') #5 /wordpress/core/5.2.3/wp-blog-header.php(19): require_once('/wordpress/core...') #6 /wordpress/core/5.2.3/index.php(17): require('/wordpress/core...') #7 {main} thrown in /srv/htdocs/wp-content/themes/No Phun/footer.php on line 18 [05-Oct-2019 01:03:02 UTC] PHP Warning: session_start(): Cannot start session when headers already sent in /srv/htdocs/wp-content/plugins/wp-clone-template/main.php on line 119 [05-Oct-2019 01:06:19 UTC] PHP Warning: session_start(): Cannot start session when headers already sent in /srv/htdocs/wp-content/plugins/wp-clone-template/main.php on line 119
<?php get_footer(); >
更改为
<?php get_footer(); ?>
如果不是,请从服务器错误日志中添加错误消息,以向我们提供更多信息。
footer.php中,似乎我有<?php get_ssite_url ?>
而不是<php get_site_url() ?>
。抱歉浪费大家的时间,但是我很感谢查看服务器日志的建议。他们太痛苦了,因为WordPress托管的网站不允许FTP访问。