Warning: include(/home/pixenpaa/wphats.com/wp-content/advanced-cache.php): failed to open stream: No such file or directory in /home/pixenpaa/wphats.com/wp-settings.php on line 95

Warning: include(/home/pixenpaa/wphats.com/wp-content/advanced-cache.php): failed to open stream: No such file or directory in /home/pixenpaa/wphats.com/wp-settings.php on line 95

Warning: include(): Failed opening '/home/pixenpaa/wphats.com/wp-content/advanced-cache.php' for inclusion (include_path='.:/opt/alt/php72/usr/share/pear') in /home/pixenpaa/wphats.com/wp-settings.php on line 95
How to load "wp-load.php" file in Wordpress » WP Hats

How to load “wp-load.php” file in WordPress

Sometimes we need to include or load wp-load.php file to get access from WordPress core & theme function action and if there has no way to get access from function.php file to include/require function. Basically this is really essential when we write a ajax method that need to get & return value from WordPress.

So here is the code where you can include wp-load.php file anywhere in WordPress theme:

$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
require( $parse_uri[0] . 'wp-load.php' );

That’s all.

Mehedi Hasan

Cool WordPress Developer having much agile experience to develop any kind of WordPress sites & plugins. Also good in troubleshooting, fixing & making any kind of tweaks for WP site.

More Posts

Mehedi Hasan

Cool WordPress Developer having much agile experience to develop any kind of WordPress sites & plugins. Also good in troubleshooting, fixing & making any kind of tweaks for WP site.

One thought on “How to load “wp-load.php” file in WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *