I have created a theme for the first time. but except the public area I cannot access admin by wp-admin. After changing he theme I saved redirected URL of admin which is this -->http://www.tennis-florida.com/wp-login.php?redirect_to=http://www.tennis-florida.com/wp-admin/&reauth=1, this takes me to login page and allows me to login then again none of the images are loading as they were previously mapped to localhost and now When I am trying to upload anything or add or modify post after licking submit button it gives me blank white page and I have to click back in order to get back to dashboard. So all in all the theme is completely useless. What I am trying to achieve is I have to ship this theme to client as they are already seen it and so I have to make it work.
As I said I have figured it out that the problem is with the theme(For the record I have created the theme by following a YouTube tutorial)
I am sharing all my codes
functions.php
http://pastebin.com/yXNLuciE
index.php
http://pastebin.com/B9HXKzx8
page.php
http://pastebin.com/K9tzZF8e
header.php
http://pastebin.com/ERYhXCVq
footer.php
http://pastebin.com/PT6tZBmC
style.css
http://pastebin.com/HbTWp5p7
sidebar was not required so haven't added anything in there, sidebar.php is blank.
That's all the files I have created apart from folders for images and all.
I have tried adding
ini_set('display_errors', true) ;
define('WP_DEBUG', true);
Even when I am trying to add a post and such with that another alternate admin link just after click publish wp shows blank page but the data is being added. to config and file and removing spaces in wp-config still no luck. Note: I cannot give up on theme as client has already seen this theme and I cannot provide another.
Note: This is a cross-post from wordpress.stackexchange.com as nobody answered this question.
I have already seen various other methods for solving this problem but its not working.
There's a syntax error in your PHP code which is what is causing the white screen.
SSH to the server and execute the files with the flag -l to check for syntax errors.
I am answering my own question as nobody has answered it yet and I have found the solution.
Upon some research I found about white spacing in php files. All I did to fix the issue was deleting blank lines from bottom of functions.php file, strange fix but worked.
Related
So i have Wp rocket on my site and i saw that every time i modify a image or a text from my site, the homepage appears white with only the cookie icon visible.... i have to delete cache each time this happens and also i have to check page every time.. This i what support said but no clue.....
I enabled WP Debug while performing the following test:
I made a small edit (added a dot at the beginning of the content) and saved the settings. I visited the page from desktop and from mobile, but it rendered correctly. I repeated the test by reverting the change I made. Still, the page got rendered correctly.
So far I could not reproduce the issue, but I checked the information provided by Sandy. Based on my observations, the issue is not related to WP Rocket, but I will explain to you why you see it when WP Rocket is enabled.
Generally, when a page is rendered in WordPress your theme is rendering the following parts of the code in the exact order for each page:
header.php
template (i.e. the content)
footer.php
When the issue occurs, the template part is missing. Here is how I found it:
Sandy was able to reproduce the issue in the past and shared the code difference between the blank page and the correctly displayed page. You can find it here: https://www.diffchecker.com/AKBv9sVj/
Here is the place where part of the HTML is missing on the "blank" page. And I highlighted the last line of code that is included in both cache files:
Full-screen image: https://i.imgur.com/28DgxpT.png
That last line of code comes from header-adora-framework.php which is included with no issues:
Similarly, the next segment that both pages have in common comes from the footer:
Full-screen image: https://i.imgur.com/wsw4wHk.png
This is where the code in footer-adora-framework.php, and it is also included with no issues:
Full-screen image: https://i.imgur.com/9Nw0QDv.png
Based on this, I can see that the template part is missing. It seems your theme is not rendering the template sometimes.
I checked the debug.log that is available on the server and found the following fatal error that might be related to the issue:
Here is the main part of the error: "The template "/wp-content/themes/project-theme/templates/layout.html.php" cannot be rendered."
If you check the file mentioned in the error, you will find that this is exactly the part that is missing:
Full-screen image: https://i.imgur.com/SpLKbyH.png
The code from /wp-content/themes/project-theme/templates/layout.html.php:
Full-screen image: https://i.imgur.com/7KfMxCR.png
The reason that you see the issue only when WP Rocket is enabled is due to caching. WP Rocket "takes a snapshot" of the page the way it was rendered the first time it was accessed.
If the template did not render the template part when the page was accessed - this is how the page will be cached and you will see the issue persists.
This, however, does not mean that the issue is resolved when you disable WP Rocket.
The issue is happening, but it is not persistent as with caching. Refreshing the page when caching is not present would likely resolve the problem.
You would need to pass this information on to your theme support. Possibly they will have suggestions on how the problem can be resolved.
I try all but nonthing. I hope to fix this with your help
This is really puzzling me.
Here is the code:
https://gyazo.com/ba7d47653583d071d5fae6be20d8af25
When I have it as is with return view('pages.ClientRedirect'); it throws the header error. If I take away the return and just have view('pages.ClientRedirect'); the logic changes so it doesn't throw the error anymore, but obviously no longer works.
I've looked into the problem and the only answer I could find would be using rawurlencode() to encode the url, but then I get a missing view error because it's looking for an encoded url instead of the url my route is looking for /ClientRedirect
I must be overlooking something!
The problem turned out to be that Laravel's built in auth wants to direct to a specific view and I was trying to redirect to a different view, ending up in two views being called at the same time hence the error.
I fixed it by overriding the OG with what I wanted
Notwithstanding the earlier comments that you should be returning a redirect not returning a view, the most common cause of the "new line detected on return view" error is an incorrectly terminated PHP file in one of your libraries or classes. It's common convention these days to leave PHP files unterminated, e.g.
<?php
some_code();
If however one of your library files that you are including includes a termination followed by a newline then that's the cause of your error. Something like this:
<?php
some_code();
?>
(blank line here)
... that would be the cause of your problem, because the blank line is emitted by the PHP interpreter as HTML at the point where the file is included. Remove the termination and the blank line and that should solve the problem.
Well, I ran into the same Issue when I wanted to migrate my WordPress website to a new host and I battle it throughout the night. The solution that worked for me is as given below..... ..
Actually, the error was caused by a space (white space) after the site or home URL in the WordPress database:
The error message (Warning: Header may not contain more than a single header, new line detected.)
To fix this error, you can make changes to the site or home URL from within the WordPress Dashboard or through the WordPress installation's database.
Fix URLs within the WordPress Dashboard
To fix the home and site URLs from within the WordPress Dashboard:
List item
Log into your WordPress Dashboard.
In the left-hand menu, go to Settings > General.
In the WordPress address (URL) and Site address (URL) fields, make sure there are no spaces after the URLs .
Click Save Changes.
Fixing the URLs within phpMyAdmin (Manually Edit Database)
To manually edit the site and home URLs within your WordPress database:
List item
Log into cPanel.
In the Databases section, click on the phpMyAdmin icon.
From the left menu, select the database for your WordPress installation.
From the left menu, select wp_options.
Find and edit the records for siteurl and home, ensuring that there are no spaces after the domain name.
I'm using Joomla v1.5.26 and for whatever reason when I navigate to MYSITE.com/administrator/index.php?option=com_content&task=add or if I try to edit any already existing articles (or sections) I get a screen with an empty body tag.
The other pages in the administrator part seem to be working.
It seems to be the same (or very similar) problem as this: http://www.justanswer.com/computer-programming/32fo1-when-hit-new-button-article-manager-joomla.html but this is the only instance I could find of the problem, and it isn't resolved at the end of the article.
Thank you for your help.
My suggestion:
1- Try to disable the editor you are using (Set it to no editor on global settings or on the user you are trying to edit with)
2- Try to reupload components/com_content from Joomla 1.5.26 source to your website and overwrite the existing file. There might be something missing.
I've seen this issue happen before with pages outside of the admin.. but never had this issue happen inside of the admin. I just get a blank white page with no errors when I go to www.example.com/admin/content. I checked the php, mysql, and apache error logs and there are no errors being written when I browse to the content page. Any ideas what the issue could be? :-/
Update..
Alright.. I figured it out. There was a page that had some images with some screwed up src attributes. The src was full of thousands of lines of random characters. No idea how or why that happened. I removed those lines from the database and all is good.
I know this post is old, but, I had a similar problem and was able to find the "node" area in the database.
For me, I went into the cpanel of my site, then the phpadmin, then found my database name, from there, a directory with a prefix_node was listed, clicked on that and went to the last page to find the most recent posts/pages. From there I was able to delete the problem pages (which are nodes in drupal)
I am new to SMF.
I just installed SMF on my website. I tried editing the index.template.php . After saving changes, it displays raw HTML and PHP on the browser. I tried fixing the prob by returning the the page back to the original state to no avail.
At the moment, everything is gibberish both frontend and backend.
Pls what do i do?
There should be at least an open tag at the top of the file (at the top of every .php file). Make sure you didn't remove this tag. Everything outside of a <?php is interpreted as normal text so if you have removed this it would explain your issue.
Also, being an ex-team member for SMF I can assure you its better to create a copy of the default theme, then make your edits to that theme. Then if you experience an error you can always pass a param in the url to reset to the default theme (in case you need to get into the admin area). To do so end the url with index.php?theme=1