Robin Cox
Robin Cox

Reputation: 1490

Wordpress and interchange.js

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?

Upvotes: 1

Views: 196

Answers (1)

Saxafrass
Saxafrass

Reputation: 11

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');

Upvotes: 1

Related Questions