WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

OK so I'm trying to use the plugin "adrotate" outside of the loop for my frontend.

I can access all the WP functions I need for everything else using


The plugin has a function called adrotate_group() which is just in a script file, no class or anything.

function adrotate_group($group_ids, $fallback = 0, $weight = 0) {
    global $wpdb, $adrotate_config, $adrotate_debug;

This outputs NULL when I call it like so on my frontend

echo adrotate_group(1);

$adrotate_config is setup in another setup script for this plugin and I've done some var_dumps there and it outputs to my frontend correctly.

Below is where the variable is set

enter image description here

For some reason using global $adrotate_config in that function isn't working, however using get_option('adrotate_config'); does, but I cannot go edit all of the plugin functions to use this as it will break on updates.

I think it has to do with the way I'm hooking wordpress.

share|improve this question

closed as too localized by s_ha_dum, Rarst May 31 '13 at 17:09

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 0 down vote accepted

OK FIXED using

define('WP_USE_THEMES', false);

instead of wp-load.php

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.