404 page is not showing - wordpress

I don't know why my site is not showing 404 page instead giving this output
Warning: include(none): failed to open stream: No such file or directory in /thefundu/public_html/friedcoffee/wp-includes/template-loader.php on line 75

the warning comes from PHP's settings to show warnings. ( its the default instalation setting)
you dont get a (apache) 404 becouse with wp the page you requested was index.php. So for apache you got your page (index.php). and its not a 404, its the index.php.
normaly u get a 404 from wp. but in this case u got a error and the wp own 404 was not handled.
your wp is not working right and fails to load the file. The end result is a empty page becouse it could not load anything else. ( the warning is a diferent way of output not part of your page )
i am no wp expert but include(none) says to me that you have no templated selected... maybe u need a template.
( the wp 404 error uses the template to make the wp 404 look shiny :D... the apache 404 just says "Not found" in ugly letters. ( and then there are browsers that also handle 404 to make it look beter ) )
edit :
considering u want to figure this out. Open the Template-loader.php and add echo's around what u want to know.
echo the $template before the include. its usefull to know what u put into the include.
echo the result of get_404_template(); (before the big if statement )
echo some text before the $template = get_index_template();
this will give u some information on where it goes wrong. I think its a problem in the settings or template but thats always hard to find.
edit 2:
i wonder where the 'none' comes from. it comes from one of those get_ fucntions. but u have to find out witch one. If u know it it also might help in the search on where the 'none' comes from. It lookd like a setting.

Related

My Fonts get changed after refreshing about page in wordpress

When I go to this page from home page. It shows proper font. But when I refresh this page its font gets changed.
Please see the screenshots:
check your browser console there is font error means fonts not found
GET http://www.stitchstudio.co/about/fonts/DINNextLTProBold.woff2
GET http://www.stitchstudio.co/about/fonts/DINNextLTProRegular.woff
GET http://www.stitchstudio.co/about/fonts/DINNextLTProBold.woff
GET http://www.stitchstudio.co/about/fonts/DINNextLTProRegular.ttf
GET http://www.stitchstudio.co/about/fonts/DINNextLTProBold.ttf
GET http://www.stitchstudio.co/wp-content/themes/lens/theme-content/css/fonts/DINNextLTProRegular.woff2
GET http://www.stitchstudio.co/wp-content/themes/lens/theme-content/css/fonts/DINNextLTProRegular.woff
GET http://www.stitchstudio.co/wp-content/themes/lens/theme-content/css/fonts/DINNextLTProRegular.ttf 404 (Not Found)
check path and fix it then it works perfectly
I guess you are not pointing to the theme directory in the right way, you should use get_stylesheet_directory_uri() or similar.
<?php echo get_stylesheet_directory_uri(); ?>/font-folder/font.extension
right now, it's not using it, so from homepage, font gets loaded because it points to:
http://www.stitchstudio.co/fonts/DINNextLTProRegular.woff2
for other pages it is not, and it will use page url, not site url, just like:
http://www.stitchstudio.co/about/fonts/DINNextLTProRegular.woff2
causing the error.

wordpress auto generate pages from sub url of page

Hoping someone can help. I don't want to create actual pages in the backend of wordpress but i want to know how i can make it so if anyone goes to a url: mydomain.com/page/sub-url.
Then i can grab that "sub-url" and output a page with content i generate via php.
If i grab that "sub-url" and i don't want to output i can do a 404 error.
I want to try to stay away from editing the htaccess file is possible but if i need to i can.
Everytime i try search for this, i get result for creating actual pages in the backend automatically which i don't want.
I think what you're looking for is a custom rewrite endpoint, which you call 'page'. Then on yourdomain.com/page/sub-url, 'page' is the parameter and 'sub-url' is the value. You can get that value with the function get_query_var().
After applying, be sure to go to your Wordpress admin->Settings->Permalinks, and click save to flush the current rewrite rules.
Update:
Use this code to show a 404 page
global $wp_query;
$wp_query->set_404();
status_header( 404 );
get_template_part( 404 );
exit();
(source)

Only the left menu toolbar is showing up on Wordpress admin

When I log in to my Wordpress admin, only the left menu toolbar is showing. Nothing else is displaying. The website front end works fine.
What I've done so far to investigate:
Renamed plugins folder to pluginz to make sure none of the plugins are doing this
Made sure there is no javascript error on the page
Made sure there is no 404 errors
Temporarily removed .htaccess to eliminate possible htaccess issues
Made sure there is no fatal php error thrown on admin
Any idea what might be going on?
I was able to fix the issue with help from here :
To fix the bug:
Open file blog/wp-admin/includes/screen.php in your favorite text editor.
On line 706 find the following PHP statement: <?php echo self::$this->_help_sidebar; ?>
Replace it with the statement: <?php echo $this->_help_sidebar; ?>
Save your changes.

Warning: Cannot modify header information when using require or require_once

I'm WordPress newbie.
I'm creating a plugin that redirect to custom login page each unregistered user access a website, let say the custom login page : custom_login.php.
I am able to create a code to redirect it but it seems no wordpress functions work in custom_login.php. So, I think I have to load something through the file. I guess wp-load.php.
Then I add some codes below at the top of the page :
<?php
require( 'd:\xampp\htdocs\wordpress\wp-load.php' );
?>
But then I got this error :
Warning: Cannot modify header information.....
I changed to require_once but still get similar error.
Some solutions of this forum threads advice to delete any whitespace. Frankly, I don't know what does it mean but I tried to delete all whitespace anyway so that the code become :
<?php require('d:\xampp\htdocs\wordpress\wp-load.php');?>
But it does not solve anything. The error is still exist.
Please help me, the expert ones.
Thanks in advance
Try inserting a system path relative to localhost, like this:
require( '/wp-load.php' ); // or just
require( 'wp-load.php' ); //
All depends on the location you are trying to include wp-load.php from.
On the other hand, you don't have to include wp-load.php if you place the file custom_login.php. in the stylesheet directory as a template or as a custom page. The way to do it is:
.1 Rename the file to page-custom-login.php
.2 Move the file to the stylesheet directory (The theme directory)
.3 Go to admin and create a new page with the title "custom login"
That's all. Now WP will treat that file as a single custom page.
They are correct - you have a space before the opening php tag in one of your files. It can be a bit tricky to find, but look hard.
If you can't find it, try looking for ob_clean() php function to help.

Wordpress goes blank after publishing new content?

So out of no where after clicking the publish button the page just goes blank...
The url at the top is:
http://www.brightboxstudios.com/sociabulls/wp-admin/post.php
What's good news is it still posts the content :)
Not great at coding so details rock :)
I was getting same error, when I update the site content and press update it goes to /wp-admin/post.php and this appears as blank page.
It is solved by:
I removed all the spaces at the end of functions.php file, I had included a widget and there were some spaces in between older content and new widget function, when I removed the spaces everything is working fine.
if that don't work then
- go into wp-config.php and find this "define('WP_DEBUG', false);"
change its value, if it is flase, make it true or if it is true change it to false.
And everything must work Good.
Thanks
A blank page usually means Apache failed. Check your error logs. You'll probably find a line that starts with:
PHP Fatal error:
You can also display your errors on the screen instead of looking at the log.
There will be many reasons for blank page, you have not mention version for wp, php etc.
To solve wordpress blank page issue follow the steps
disable all plugin and try (if there is an error in plugins then enable 1 by 1)
switch to default theme and try (if there is an error in theme)
rename .htaccess and param-link to default (page/post id)

Resources