Wordpress and interchange.js

201 views Asked by At

In a wordpress blog I'm working on, I am using interchange.js (by Zurb) to dynamically load a php file if the screen width is greater than a given value.

I need to run wordpress stuff in this php file, which don't seem to work since I load it with javaScript.

Does anybody know if I have to use wp_load.php (in that case how) or can I fix this another way?

1

There are 1 answers

0
Saxafrass On

Include this at the top of the php file you are loading via interchange.

require($_SERVER['DOCUMENT_ROOT'].'/wp-load.php');

if it's running on your local machine/server you may need to include the site path:

require($_SERVER['DOCUMENT_ROOT'].'/path-to-site/wp-load.php');