Page content not showing in one theme - php

I have a WordPress site that has a custom theme. WordPress is not my framework of choice, so I'm a bit of a novice. There are 2 scenarios happening.
Theme shows content fine on Hosting A
Theme does not show content on Hosting B
TwentyTwelve and TwentyEleven show content on Hosting B
So, there seems to be something wrong with the custom theme on Hosting B, however, nothing sticks out. I've deleted and reimported the theme, still with no success. I've copied over the page.php file (again for sanity), still with no success. I've deactivated and reactivated all plugins one by one just to see if it was one of those, again, with no success.
Is there something I could be missing?

If you're having issues like this with a theme on one host but not another, it's possible the theme is using a deprecated PHP function, has warnings, etc.
If Host B has less forgiving server rules, it sounds like they might be halting the request (which results in a white page for your users).
Your best bet would be to either find the error logs for Host B, or perhaps loosen the restrictions and allow errors and warning messages. Of course, you'll want this to be a setting in your development environment (not on a production site).
I use the Debug Bar plugin to also help surface any issues while in development.

Related

WordPress Multisite has one site that gets a 500 error on the homepage on the first load

Title pretty much sums up the issue. A client has a multisite and one of the sites returns a 500 error when opening in a fresh browser until you perform a hard refresh.
Screen is completely white (on firefox) and doesn't output any errors when setting WP_DEBUG to true.
We were getting LimitInternalRecursion errors and we've tried everything we could find around that.
The .htaccess config is the default multisite config besides stuff added by plugins like wp rocket and really simple ssl.
It's really strange because it's literally the one site and just the homepage.
site: https://survive-a-storm.com
It seems to be caching problem more than accessing problem. If you are using cache plugins or maybe something in your hosting panel, check it.
I know Wp-rocket setting has many option for loading pages from hosting.
Last thing is using CDN, if you have it, check it.

Theme related WSOD in backend for other users

After trying out all typical solutions for wordpress wsods, I am out of ideas.
I migrated my website from wordpress.com to a self-hosted solution using all-in-one-wp-migration, which looked to work fine, until a coworker wanted to use the backend and got wsod.
After going through all the suggestions for fixing wsods and a few of my own, namely:
checking every single plugin used
checking memory (980m should be enough?)
deleting and reinstating all saved accounts
scrubbing the database off of old wordpress.com entries or deprecated urls
running debug mode and not getting any logs from the wsod
I of course landed on my self made theme as the issue. I went over the functions.php file to remove and clean up all custom additions that are not necessary for functionality. I used a theme check plugin to help me weed out most of the issues that come from being a beginner at this, but nothing looks to be related at all to backend.
Especially irritating is the part where it works fine for me while using my pc, but any other device, like smartphone, tablet or other pcs can't seem to get into the wp-admin version of the site while my theme is activated.
P.S.: while the theme is active, backend functionalities like searching for new plugins or changing settings seem to not work right or lead to wsod even for me.
For anyone running into a simillar issue, the solution given by online guides always mentions making sure the END of the functions.php file does not have any empty space there, but they neglect to mention that there can't be any empty line anywhere in the whole file, even within the code.

Wordpress Plugin Broke My Site & Cant Figure Out How To Resolve?

Ok so long and short of this is, I built a custom plugin for a Wordpress site and was working on a small update. Think perhaps I have a small typo error in the code but after saving the update my site is now showing a 500 error.
I have already attempted the following usual methods without success:
1: renamed the plugin and plugins directories to attempt to both disable individual/all plugins.
2: disabled all plugins via db.
Now the change itself was made via the wp back end, which updated the file. However I cannot see this change via FTP. This baffles me. I would assume somehow the database updated the file somewhere within itself which is perhaps overriding the original file? I haven't seen Wordpress do this before.
I'm not sure but would like to be able to figure out why this happened and if it's fixable.
For now I am just going to do a rollback. Any thoughts on this would be most welcome.
I suggest you try:
restoring the database. If you can’t see which file changed probably means that the database was changed and not a specific file. A popular plug-in for back up and restoration is updraft plus which enables you to select files, the database, or themes. Assuming you don’t have a restore plugin installed you could contact your hosting provider who may be able to restore the database to an earlier version. This functionality may also be available through the control panel on the Domain and Hosting. If this works then at least you know where the trouble lies with your dog and development.

Wordpress blank page after activating theme, but works in other server

I'm trying to activate a Wordpress theme but all I got is a blank page, also the admin page goes blank.
Version of WP is 3.9.1, Mysql 5.1 compatible and PHP 5.2.4 compatible too with WP. The theme in question is MH Magazine and I have it in another server with the same configuration and is working ok.
Even I tried to do a backup of the working site and place it in the production server and still goes blank.
I tried uploading the max_memory_limit in php and no luck. Error log and show php errors doesnt show anything, when I check only says the site name HTTP 1.1 500 - If I set wp_debug to true says HTTP 1.1 200.
File permissions are ok too.
A SIMPLE FIX FOR NON TECHIES (Like me really)
Loads of forums recommend various code changes and things to try, non of which worked, so I logically worked through the process more simply and solved it myself (in my case). White screen for everything, including front end and Admin. I tried everything going!
Essentially I'd asked Wordpress to link to a theme, which it did, but now I can't change it back. As it wouldn't automatically switch back to default themes, as suggested by others as a result of simply deleting the theme folder via ftp, I would have to force that myself. Without access to the admin panel, how would I change the link (easily)?. Well I can't, so instead I need to force the change of what it links to instead!
In the end I basically logged in via FTP, went to the wp-content folder, then to themes, located my list of theme folders and changed the theme folder name of the one recently selected and causing the issue, by just adding an x at the end (random letter). Then I changed the theme folder 'default' to the name of the theme which was causing the issue, then refreshed my site in the other window, at which point it displayed again. So the hard coded link never changed, but the basic files it links to now have.
The site was now back up, thank god! I then logged into the Wordpress admin panel and updated my version of Wordpress, as to be honest it had been a while and it was a little out of date, so a likely culprit for the cause of the error. Once updated, I then went back into the FTP window, renamed the folder back to 'default', and then removed the 'x' character from the end of the actual theme folder that I wanted to use. And ta dah, it now works beautifully with the theme I wanted! Without any fancy code changes or messing around with reinstalling or removing etc. BOSH!!
Hope this helps a few people out. (obviously it's different strokes for different folks)
To get this out of comments --- this is a community wiki answer.
Are your two servers running on the same platform (Linux? Win?) or different ones?
Do you have the same collection of plugins on both platforms?
Here are some things to try.
do View Source on your white screen of death and see if there's anything in the source view that can help you diagnose your problem.
deactivate all your plugins, then try the theme.
if it doesn't work, then this theme is broken on this server setup.
reactivate the plugins one by one. One of them will probably give you the white screen of death. Then you know that plugin is incompatible with that theme.

Developing Wordpress theme on a live site

What's the best way to work on a WP theme on a live site? So that the users see the current theme and I can see the one I'm working on. I know WP has a preview theme option, which works, but it has a sidebar that lets you go back to the WP management page, which means when I try to inspect the source it has lots of extra stuff that the actual theme wouldn't have.
Any ideas? Thanks.
Working on a live site is not a good idea. All changes you make will be viewable to your users.
You have two options here. The first option is to create a subdomain like test.example.com and install wordpress there. From there you can do changes to the theme without worrying about the live site. Once done, you can just move your theme over to the live site.
The second and best option is to install wordpress locally on your pc. I use xammplite for that purpose. It works the same as a live install, but it is faster making changes to a theme. Also, if you make a mistake somewhere like a syntax error, you can correct it quickly, no need to ftp a file backwards and forwards between pc and live site.
If this doesn't cut it, your last least favored option is to download a maintanance plugin and put your site in maintainance mode. You will be able to see and test your site, and everyone else will see a maintainance notice

Categories