1

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?

Robin Cox
  • 1,470
  • 2
  • 16
  • 31

1 Answers1

1

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');
Companjo
  • 1,789
  • 18
  • 24
Saxafrass
  • 11
  • 1