Replies
- Brajesh Singh on November 18, 2015 at 5:18 pm in reply to: Trying to improve the Group home page #1674
Thank you.
I am glad it is resolved now 🙂 - Brajesh Singh on November 18, 2015 at 5:00 pm 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.
- Brajesh Singh on November 18, 2015 at 4:47 pm 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. - Brajesh Singh on November 18, 2015 at 4:45 pm 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.
- Brajesh Singh on November 18, 2015 at 4:34 pm 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.
- Brajesh Singh on November 18, 2015 at 4:08 pm 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.
- Brajesh Singh on November 18, 2015 at 3:23 pm 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.
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.
- Brajesh Singh on November 18, 2015 at 12:43 pm 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( 'post_parent' => $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.
Continued discussion here
https://buddydev.com/support/forums/topic/rebp-list-users-in-dir-with-role/