K
K
Konstantin Teploukhov2018-05-25 23:55:20
WordPress
Konstantin Teploukhov, 2018-05-25 23:55:20

How to make wp functions work in your php file?

How to make wp functions work in your php file? It is located in my \wp-content\themes\landingpage\js\emailSendParticularly interested in functionsget_option('blogname');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Syomka Gavrilenko, 2018-05-26
@blood-moon

In order to use WP functions in a third-party script, you need to download the WordPress core .
To do this, you need to insert at the beginning of the file:

# Load WordPress Core
// Assuming we're in a subdir: "~/wp-content/themes/landingpage/js/emailSend"
require_once( '../../../../../wp-load.php' );

Now you can use all the features of wordpress

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question