View Single Post
  #1  
Old 09-27-2012, 11:35 PM
trishasalas trishasalas is offline
Registered User
Genesis Member
Pro Plus Member
 
Join Date: May 2012
Location: Tulsa, OK
Posts: 3
Red face Permalinks not working in Custom function

I wrote a custom function for displaying random buddypress groups and the permalinks arent' working no matter what I do. I have tried printf() as well as echo...all it does is display the link itself next to the item I want to be the link.

The code is in a custom template with other standard genesis widgets before and after it.

I am fairly new to php but know enough to at least get this far and understand what I'm doing but I can't figure out what I'm doing wrong. Can anyone help with this?

Here is the link: http://dev.trishasalas.com/

and here is the code:

PHP Code:
$args = array(
     
'type' => 'random',
     
'max' => 3
);

    if ( 
bp_has_groups $args ) ) {
 
        echo
'<div class="featured-middle-left">';

        echo
'<h3>Check Out Our Growing Network Of Groups</h3>';
 
        echo
'<ul id="groups-list" class="item-list">';
           while ( 
bp_groups() ) : bp_the_group();
 
        echo
'<li>';

        echo 
'<div class="thumbnail">';
            
        echo
'<a href='.bp_group_permalink().'>'.bp_group_avatar().'</a>';

        echo
'</div>';
         
         echo
'<h2>';

               
printf('<a href="%s">%s</a>',
                
bp_group_permalink(),
                
bp_group_name()
                );

           echo
'</h2>';

        echo
'<div class="item-desc">';
        
bp_group_description_excerpt();
        echo
'</div>';
 
         
do_action('bp_directory_groups_item');

        echo
'</div>';
 
        echo
'<div class="action">';
        
        
bp_group_join_button();
        echo
'</li>';

        endwhile;
          echo
'</ul>';
          echo
'</div>';
      } 
Thanks!
Trisha in Tulsa