theme development - WordPress does not load page template or anything else, just empty page with header and footer

So, I have this issue, where this happened two times. There is two pages - blog (which is based in index.php) and Thank

So, I have this issue, where this happened two times. There is two pages - blog (which is based in index.php) and Thank you page (page-thanks.php).

In some conditions, these two are blank and in "admin bar" (black one on top of the page) is showing just "Blog" title and can't edit the page.

On the page, there is just header and footer (it's loading correctly). But where should be content, nothing is loading.

Query Monitor is showing in "Template" hooks just "home.php" and "index.php" as final load file.

First time, I switched off WP Rocket and it started working. The second time, I activated twentytwenty theme and then reactivated my theme.

And in both cases, it stared working as it should. But there is no log of any kind about error, warning or anything. I can't reproduce it anywhere and it happened only on PROD server - not on localhost.

I have no idea, what to do or how to investigate that.

PS: I am developing sites for years and this is first time, I see something like that.

So, I have this issue, where this happened two times. There is two pages - blog (which is based in index.php) and Thank you page (page-thanks.php).

In some conditions, these two are blank and in "admin bar" (black one on top of the page) is showing just "Blog" title and can't edit the page.

On the page, there is just header and footer (it's loading correctly). But where should be content, nothing is loading.

Query Monitor is showing in "Template" hooks just "home.php" and "index.php" as final load file.

First time, I switched off WP Rocket and it started working. The second time, I activated twentytwenty theme and then reactivated my theme.

And in both cases, it stared working as it should. But there is no log of any kind about error, warning or anything. I can't reproduce it anywhere and it happened only on PROD server - not on localhost.

I have no idea, what to do or how to investigate that.

PS: I am developing sites for years and this is first time, I see something like that.

Share Improve this question asked Dec 28, 2019 at 12:42 DoctoreDoctore 136 bronze badges 1
  • Are you using the same version of PHP in both environments? Sounds to me like there's a difference between the local and the production environments. It'd also be helpful to see some code, maybe just minimal versions of the template files. – markcbain Commented Jan 2, 2020 at 18:02
Add a comment  | 

1 Answer 1

Reset to default 1

I think, it's because of DNS problem. The old site URL is likely the public DNS name for your EC2 instance when you installed WordPress. If you are not sure of your old site URL, you can use curl to find it with the following command.

curl localhost | grep wp-content

You should see references to your old public DNS name in the output, which will look like this (old site URL in red):

<script type='text/javascript' src='http://ec2-52-8-139-223.us-west-1pute.amazonaws/wp-content/themes/twentyfifteen/js/functions.js?ver=20150330'></script>

Download the wp-cli with the following command.

curl -O https://raw.githubusercontent/wp-cli/builds/gh-pages/phar/wp-cli.phar

Search and replace the old site URL in your WordPress installation with the following command. Substitute the old and new site URLs for your EC2 instance and the path to your WordPress installation (usually /var/www/html or /var/www/html/blog).

php wp-cli.phar search-replace 'old_site_url' 'new_site_url' --path=/path/to/wordpress/installation --skip-columns=guid

In a web browser, enter the new site URL of your WordPress blog to verify that the site is working properly again.

let me know if that works!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742292252a4416416.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信