[英]WordPress Theme: Standalone theme need index.php file ERROR
[英]How to fix “id=error-page” default on index.php in a WordPress theme
我正在創建一個自定義 WordPress 主題,並且我想要自己創建多個頁面。 創建第二個頁面后,在我將其他頁面的模板更改為我創建的新頁面后,主頁現在顯示在一個奇怪的中心 alignment 的 body 標記中, id=error-page
。 這些都不應該對索引頁面產生影響。
我嘗試將我的 index.php 復制到 home.php 中,但索引頁面仍然加載奇怪的中心 alignment 並在正文標簽中包含相同的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 訪問。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.