BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 24774
    Brajesh Singh on in reply to: Trying to improve the Group home page #1674

    Thank you.
    I am glad it is resolved now 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 24774
    Brajesh Singh on in reply to: Trying to improve the Group home page #1671

    Hi George,
    Delete all that code and put this in your file

    
    	<?php
    		$forum_ids = bbp_get_group_forum_ids( bp_get_current_group_id() );
    		$forum_id = 0;
    		if ( ! empty( $forum_ids ) ) {
    			$forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids;
    		}
    	?>
    	<?php if ( $forum_id && bbp_has_topics( array( 'post_parent' => $forum_id ) ) ) : ?>
    		<?php bbp_get_template_part( 'loop', 'topics' ); ?>
    	
    	<?php endif; ?>
    
    

    That will work and I have tested it. you will need to do the css though.

    Hope that helps.

  • Keymaster
    (BuddyDev Team)
    Posts: 24774
    Brajesh Singh on in reply to: Trying to improve the Group home page #1669

    Hi George,
    Please post the code. That will allow me to help you better.

  • Keymaster
    (BuddyDev Team)
    Posts: 24774
    Brajesh Singh on in reply to: Trying to improve the Group home page #1667

    Can you please post the code here( only till the bbp_has_topics() ) code block. No need to post the content inside the loop. Most probably you are not passing the forum id.

  • Keymaster
    (BuddyDev Team)
    Posts: 24774
    Brajesh Singh on in reply to: Trying to improve the Group home page #1665

    Are you using my previous code to get the $forum_id before using the above snippet. If not, then that’s why It is happening.

  • Keymaster
    (BuddyDev Team)
    Posts: 24774
    Brajesh Singh on in reply to: Trying to improve the Group home page #1663

    Hi George,
    Thank you for confirming.

    It won’t cause error but will list recent topics which is not a great thing to do.

    The better strategy will be doing like

    
    <?php if( ! empty( $forum_id) && bbp_has_topics( array( 'post_parent' => $forum_id )  ) ) :?>
    
    //show loop
    <?php endif;?>
    
    

    Hope that helps.

  • Keymaster
    (BuddyDev Team)
    Posts: 24774
    Brajesh Singh on in reply to: Trying to improve the Group home page #1660

    In that case we can put the following

    
    <?php if ( bbp_has_topics() ) : ?>
    
    //our loop code here..
    
    <?php endif;?>
    
    

    Please don’t forget the changes I mentioned.

  • Keymaster
    (BuddyDev Team)
    Posts: 24774
    Brajesh Singh on in reply to: [Resolved] MediaPress #1659

    Hi Marc,
    I am glad it is fine now.

    Please do note that there are continuous updates on github but I haven’t bumped version. Consider that beta 1 as dev branch. So, It is always good to check for changelog when updating instead of relaying on the version number for MediaPress.

  • Keymaster
    (BuddyDev Team)
    Posts: 24774
    Brajesh Singh on in reply to: Trying to improve the Group home page #1656

    Hi George,
    Thank you. I am glad we are progressing towards the result.

    Try looking for this line in your custom loop

    
    
    bbp_has_topics ()
    
    

    and we need to modify it to

    
    
    $forum_ids    = bbp_get_group_forum_ids( bp_get_current_group_id() );
    
    if ( !empty( $forum_ids ) ) {
    	$forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids;
    }
    
    bbp_has_topics ( array( &#039;post_parent&#039; => $forum_id ) );
    
    

    That will fetch the topics for relevant groups.

    You will also need to check if the forum_id is empty then to avoid showing the loop.

    Hope that helps.

  • Keymaster
    (BuddyDev Team)
    Posts: 24774