Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Site Members Loop & Variables


dunc
Participant

@dunc

@burtadsit I have been able to achieve a positive result using @jeffsayre ‘s code, however I want to set the value of my $var outside the template. Do you know if this is possible? I fear not based on what you said above:

“I’ve run into this before. That code snippet above only works if the $foo’s are created in the template. The code underneath that contains $foo’s is a different scope.”

I’ve tried setting my $var in my functions.php file and in my custom page template by hooking in to bp_before_members_loop:

<?php
function my_function() {
$var = ‘xxx’;
}
add_action(‘bp_before_members_loop’,’my_function’);
?>

Many thanks!

Skip to toolbar