Re: Trying to Run a if group = “this name”
I have tried it, with this code
<?php get_header(); ?>
<div id="content" class="widecolumn">
<h2 class="widgettitle"></h2>
<div id="localphone">
<?php if ( bp_has_site_groups() ) : ?>
<div class="pag-count" id="group-dir-count">
<?php bp_site_groups_pagination_count() ?>
</div>
<div class="pagination-links" id="group-dir-pag">
<?php bp_site_groups_pagination_links() ?>
</div>
<?php while ( bp_site_groups() ) : bp_the_site_group(); ?>
<?php $localPhone = bp_get_the_site_group_name() ?>;
<?php if ($localPhone="Manchester" || $localPhone="Test Group") {
echo '<dl>';
echo '<dt><a href="http://business-chamber.com/featured-<?php bp_get_the_site_group_name() ?>/" title=""><?php bp_get_the_site_group_avatar_thumb() ?></a></dt>';
echo '<dd><?php bp_get_the_site_group_name() ?></dd>';
echo '</dl>';
} else {
echo 'hello';
}
?>
<?php endwhile; ?>
<?php else: ?>
<div id="message" class="info">
<p><?php _e( 'There were no groups found.', 'buddypress' ) ?></p>
</div>
<?php endif; ?>
</div>
<?php get_footer(); ?>
Im now getting
;
;
hello;
I definately have the 2 test groups there and it is doing something right, as in only returning the hello for the last one where I don’t have a || condition.