Thanks, I’ve spent more time on this, the ad inserter plugin was conflicting. I’ve emailed the plugin author, for future reference a temporary fix is to comment out line 1035 in the ad-inserter.php file
So this:
if (!$query->is_main_query()) return;
becomes:
// if (!$query->is_main_query()) return;
—
More details
Turning on debug shows the following error:
BP_Groups_Group_Members_Template::is_main_query() in /home/cross/www/wp-content/plugins/ad-inserter/ad-inserter.php on line 1035
For reference, here is the code around line 1035
In the short term I’ve just commented out line 1035, though would be best to get a full fix for this
if (!$query->is_main_query()) return;
// Process Before Title postion
function ai_loop_start_hook ($query){
if (!$query->is_main_query()) return;
if (is_feed()) return;
//get post published date
$publish_date = get_the_date (‘U’);