wp-blog-header.php problem in external html
-
Hello,
I have a WP in a directory (eg. /wp/)
The domain is https://www.example.com (for example).I have implement some fuctions from WP to my main index.html file. To be specific I parse the Featured Images from the 20 latest posts.
Code is this:
Above the HTML tag
<? define('WP_USE_THEMES', false); include('wp/wp-blog-header.php'); <-- Cause WSOD + strange Characters //include('/wp/wp-blog-header.php'); <--- NO WSOD But The code doesn't work //include(dirname(__FILE__) .'/wp/wp-blog-header.php'); <--- NO WSOD But The code doesn't work //include($_SERVER['DOCUMENT_ROOT'].'/wp/wp-blog-header.php'); <-- NO WSOD But The code doesn't work ?>
In Body Tag:
<?php $counterPost = 1; $thumbnails = get_posts('numberposts=6'); foreach ($thumbnails as $thumbnail) { if ( has_post_thumbnail($thumbnail->ID)) { $counterPost ++; echo '<a href="' . get_permalink( $thumbnail->ID ) . '" title="' . esc_attr( $thumbnail->post_title ) . '">'; echo get_the_post_thumbnail($thumbnail->ID, array(120,120)); echo '</a>'; echo ' '; } if ($counterPost % 2 != 0){ echo '<br><br>'; } } ?>
I have just update to the latest version and I have the following issue:
In https://www.example.com/ or https://www.example.com/index.html I have a White Screen of Death and some strange characters (like on this post: https://wordpress.stackexchange.com/questions/115219/strange-characters-appeared-in-header ) I am using
include
to bypass therequire
Fatal Error But I still got (Fatal) problem – a WSOD.The most “fascinating thing” is that IF I try to access to my site like this: https://example.com/ or https://example.com/index.html –Without www– I didnt see any problem. As you can see the problem is only in the (www) .
Of course, I am using apache 2.2.x and WHM/Cpanel the latest, and the www is a symbolic link to public_html. I double check the permissions and everything is 644 and 755 for folders.
Also, I has some custom rewrite rules to redirect the traffic from non-www to www, but I have disabled it for testing reason, till the time that I can find a solution about that problem with the wp-blog-header.php.
Moreover, The MOST fascinating thing is that:
I have copied the index.html and I rename it to ind2.html. I tried to access the www.example.com/ind2.html and EVERYTHING works! I haven’t a WSOD, No Strange characters, Nothing.
These 2 files (index.html and ind2.html) are exactly the same.Whats going on ?? Any thoughts? How can I fix it ??
Can you suggest me any other code to see the Feature images (and to be hyperlinked) in the external html page ?
PHP Error_log from root folder:
[18-Sep-2014 22:45:55 UTC] PHP Warning: include(/wp/wp-blog-header.php): failed to open stream: No such file or directory in /home/(account)/public_html/domain.com/index.html on line 10 [18-Sep-2014 22:45:55 UTC] PHP Warning: include(): Failed opening '/wp/wp-blog-header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/(account)/public_html/domain.com/index.html on line 10
PHP Error log from wp folder: Empty .
- The topic ‘wp-blog-header.php problem in external html’ is closed to new replies.