Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding colored box, menu with hook to bbPress?
- This topic has 8 replies, 2 voices, and was last updated 9 years, 11 months ago by Brad Dalton.
-
AuthorPosts
-
May 5, 2014 at 6:53 am #103692PavleMember
Hi,
Can anyone help me add custom boxes like on the photos to my bbPress
I contacted official support about this, and here is what they replied to me :
" The textbox above the posts was done with custom code using a hook in Genesis, not by typing in page content."Unfortunately I do not understand what that means. Can anyone give me a tip on this?
http://www.cardzreview.com/forums/May 5, 2014 at 9:41 am #103701PavleMemberSorry, I forgot to attach the image
May 5, 2014 at 10:27 am #103705PavleMemberI tried to register a widget above Forums Page.
However it seams that Forums from bbPress is not a page, does anyone know what it is?Maybe there is a mistake in code?
Here is what I have
// Register before-forum widget
genesis_register_sidebar( array(
'id' => 'before-forum',
'name' => __( 'Before Forum', 'agency' ),
'description' => __( 'This is the before-Forum section.', 'agency' ),
) );// Hook before-Forum widget to single page
add_action( 'genesis_before_content_sidebar_wrap', 'custom_before_content', 9 );
function custom_before_content() {
if ( is_page('Forums' ) && is_active_sidebar( 'before-content' ) ) {
genesis_widget_area( 'before-content', array(
'before' => '<div class="before-content widget-area">',
'after' => '</div>',
) );}}
Result is this http://www.cardzreview.com/forums/
There is no widget area above my forum.May 5, 2014 at 2:32 pm #103746PavleMemberI changed a code a bit but still no results
//* Register after post widget area
genesis_register_sidebar( array(
'id' => 'before-forum',
'name' => __( 'Before Forum', 'themename' ),
'description' => __( 'This is a widget area that can be placed before the forum', 'themename' ),
) );//* Hook after post widget area after post content
add_action( 'genesis_before_content', 'sp_after_post_widget' );
function sp_after_post_widget() {
if ( is_page( 'forums' ) )
genesis_widget_area( 'before-forum', array(
'before' => '<div class="before-forum widget-area">',
'after' => '</div>',
) );
}I have been trying for at least 3 hours, I am desperate...
May 6, 2014 at 4:08 pm #103929Brad DaltonParticipantYou need to use the correct conditional tag for bbpress.
Please paste code into a Github Gist.
Anyone that copies this code and pastes it into a file file will break their site because it hasn't been embedded properly. Thanks.
May 7, 2014 at 12:30 am #104006PavleMemberBrad, you are genius!
I swear Iยดve been trying this for hours and hours.Your site has been my #1 source of information , I have no idea how I missed this post.
It works perfectly now.
Keep up the great work with your site by the way, I feel like that almost each tutorial I see there is exactly what I need ๐
May 7, 2014 at 12:46 am #104009Brad DaltonParticipantMay 7, 2014 at 12:56 am #104012PavleMemberJust a note if everyone has similar question.
Here is a list of all conditional tags in bbpress
http://codex.bbpress.org/bbpress-conditional-tags/You can just replace is_bbpress with any tag you want.
To display it on my forum index page I used bbp_is_forum_archive()
Good luck everyone, my day started very well thanks to Brad ๐
May 7, 2014 at 4:14 am #104030Brad DaltonParticipant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.