I am creating a custom WordPress theme and I want to have multiple pages that I create myself. After creating a second page, the home page now displays in a strange center alignment with id=error-page
in the body tag after I changed the other page's template to the new page I created. None of this should of had an affect on the index page.
I have tried copying my index.php into home.php, but the index page still loads with the weird center alignment and contains the same id=error-page
in the body tag. The page displayed fine originally, but after adding a page template for a new page I was trying to create, the index has changed.
Here is the first few sections in my index.php to show my code should be correct:
<?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>
I expect the page to be normal when I load it, but I get a Failed to load resource: the server responded with a status of 500. (index):1
error as well.
Here are the most recent server logs:
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
Most likely the error is caused by this:
<?php get_footer(); >
Change to
<?php get_footer(); ?>
If that's not it, add the error message from your server error logs to give us more information.
After reading the server logs, it seems it was something simple. In footer.php , it seems I had <?php get_ssite_url?>
instead of <php get_site_url()?>
. Sorry to waste everyones time, but I appreciate the advice to look at the server logs. They are a pain to get too because sites hosted on WordPress don't allow FTP access.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.