After setting up a template file article.html in craft/templates folder, and creating the section article with the uri article and setting the entry template as article in the admin on trying to see the live preview of the page when I go to it in the entries list I get a craft page with the error:
Page not found
I thought it might have something with cache maybe, so I cleared that, but I still got the same error. Why I am getting this error, and how can I fix that?
It might be a database not updating issue, have you tried making a backup of your current database and start with a fresh one?
If not, then check .htaccess and your routes.
First crate a 404.twig file.
Open general.php file "config/general.php" and change the devMode to false.
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 have a file structure like
example.com/mywordpress/ --contains WordPress
example.com/custompreview.php --preview getter outside wordpress
I am using wp-load.php to load wordpres and using its contents. I am able to recive published posts with no problem, I even know how to make query for previews but when preview get parameters comes to the script outside the wordpress folder (custompreview.php) obviously the wp-load.php calls exit and shows only access error message.
Example is worth thousand words:
example.com/custompreview.php?preview=true&preview_id=64&preview_nonce=1f2477c5d2&post_format=standard
Shows only message "You do not have permission to preview drafts"
What is causing this? What is the wp-load.php checking for? How to fix this? :)
If you are getting this while logged in -
the session cookie may be limited to the /mywordpress folder.
Unless explicitly specified, the cookie will be valid in the subdirectory it was set in (and all children).
I'm not sure whether it is possible to change WP's session cookie behaviour, but it may help to put the PHP file inside /mywordpress.
I am a completely newbie in wordpress. At this moment, my blog URL is blog.mysite.com, and in the past it was www.mysite.com/blog.
The URLs and links are ok in the blog, because I changed the base URL in wp-config file. However, the images are still using the old route.
This is the URL of my pictures:
blog.mysite.com/wp-content/themes/canvas/functions/thumb.php?src=http://mysite.com/blog/wp-content/uploads/2012/04/bname-268x300.jpg&w=150&h=150&zc=1&q=90
As yoy can see, it is using TinThumb plugin, but the URL that it is using is the old one.
Can anyone help me to fix it?
Wordpress main drawbacks is it saves complete image url in db.
So if you migrating your site you have to search & replace url in your sql file & need to dump it again.
I suggest you to do it manually and follow the steps mention here.
Also there is plugin available to do the same named Search and Replace.
add the two lines in wp-config
define('WP_SITEURL', 'http://newsiteaddress.com/');
define('WP_HOME', 'http://newsiteaddress.com/');
please note that some plugins that use the file system like ssome caches may have to be reconfigured or the cache may be reconfigured
You need to dump database to file and replace all strings 'mysite.com/blog' to 'blog.mysite.com', and after overwrite database by fixed dump.
Sorry for my bad english.
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.