how to access wordpress without wp-load.php


#1

Hi, I want know
how to access wordpress without wp-load.php?

Thanks


#2

What do you need to access? Data only, maybe? If you need WordPress functionality - objects, functions, it needs to be loaded.


#3

thanks, I need it for create visual shortcode


#4

I still don’t understand, create it where, for what purpose? What kind of website you have that needs WordPress but doesn’t use it?


#5

Hello there,

I presented the plugon and got the accompanying email once again from WordPress:

Counting wp-config.php, wp-blog-header.php, wp-load.php, or practically whatever other WordPress center record that you need to call specifically by means of an incorporate is not a smart thought and we can’t endorse a module that does as such unless it has a justifiable reason motivation to stack the file(s). It is inclined to disappointment since not all WordPress introduces have precisely the same structure.
Document Management System.


#6

GDragoN:

for create shortcode I call it again

//Setup location of WordPress
$absolute_path = __FILE__;
$path_to_file = explode( 'wp-content', $absolute_path );
$path_to_wp = $path_to_file[0];

// Access WordPress
require_once( $path_to_wp . '/wp-load.php' );

class god_of_blue_shortcodes
{
	var	$conf;
.
.
.

but reviewer said “Please don’t load core WordPress files”


#7

Looks like you’re trying to call an Ajax request?
You should read https://codex.wordpress.org/AJAX_in_Plugins


#8

If you need to this, then your approach is very wrong. There is no need to load WordPress manually if you do things as they should be done. If you need to dynamically render content loaded through AJAX, @leafcolor pointed out the article on AJAX in WordPress.


#9

this is php file that I can not use wp function like get_template_directory() or esc_html.
this is create visual shortcode that use in the theme not as plugin from out of theme.

I try to call my php in to functions.php but nothing happen


#10

Something is very wrong with your approach. I have created over 50 themes, and never needed to load WordPress inside the theme. Theme is loaded by WordPress, and whatever feature you need it can’t require loading of WordPress. Envato will not approve the theme that loads WP.

To be honest, I still don’t understand what you try to achieve, but shortcodes for sure don’t need to load WordPress. If you need to get data dynamically, there is AJAX and proper AJAX handler in WP.


#11

as I said there is php file that I can not use wp function like get_template_directory() or esc_html. I try to call my php file in to functions.php but nothing happen.

and what you think about this.


#12

As others already pointed out, you are doing something very wrong. Of course, hard to help without knowing the details, but I believe there is an elegant, up to the standards solution for any problem when creating a WP theme. Take few steps back and take a better look (using google) if there really isn’t better way to resolve your problem other then some obscure loading of core WP files.