Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'is_bbpress'

Viewing 25 results - 101 through 125 (of 191 total)
  • Author
    Search Results
  • #148858
    ninjaunmatched
    Participant

    Okay I found the code which is on this site actually.

    click here

    But the code mentioned:

    if (is_bbpress()) :
    div class=”abc”
    else :
    div class=”xyz”
    endif;

    Still would not make sense to everyone. So I’m thinking the first part is the main part. After the colon you would change the div class to whatever you want change which would be some of the classes mentioned in this thread to another class that you create which simply just changes the font size.

    I’m thinking this way you would have to create your own classs for each thing you want to change in bbpress whether it was the reply text, the header text, or the content text. If I am off a bit or a lot just chime in. Hope it helps.

    #148163
    Robin W
    Moderator

    Getting bbpress to work with the many very clever (too clever!) themes is not always easy

    Ok, we could spend a lot of time getting a forum specific sidebar for your theme, but maybe easiest to get your sidebar working to display in bbpress

    so install widget logic

    https://wordpress.org/plugins/widget-logic/

    Then set up whatever sidebar is being displayed on the bbpress page for all the widgets that you want it to display, both for the homepage and bbpress

    Then you’ll see each widget now has a widget logic condition.

    For items you want to display only on bbpress add the logic

    is_bbpress()
    

    For items say only on a home page add

    is_home()
    

    for items you want on all pages apart from bbpress use

    !is_bbpress()
    

    Come back if anything is not clear

    #147787

    In reply to: Full Width Forum Help

    Robin W
    Moderator

    ok, this is not my strong area, but try making this as your bbpress.php page

    
    <?php 
    
    get_header(); // Loads the header.php template. ?>
     
    	<?php if ( is_bbpress() ) { ?>
     
    		<header class="entry-header">
    			<h1 class="entry-title"><?php single_post_title(); ?></h1>
    			<?php echo apply_atomic_shortcode( 'entry_byline', '<div class="entry-byline">' . __( 'Published by [entry-author] on [entry-published] [entry-comments-link before=" | "] [entry-edit-link before=" | "]', 'spine2' ) . '</div>' ); ?>
    		</header><!-- .entry-header -->
     
    		<?php while( have_posts() ): the_post(); ?>
     
    			<?php the_content(); ?>
     
    		<?php endwhile; ?>
     
     
    		<footer class="entry-footer">
    			<?php echo apply_atomic_shortcode( 'entry_meta', '<div class="entry-meta">' . __( '[entry-terms before="Posted in " taxonomy="category"] [entry-terms before="| Tagged "]', 'spine2' ) . '</div>' ); ?>
    		</footer><!-- .entry-footer -->
     
    	<?php } else { ?>
    	<div id="content" class="hfeed">
     
    		<?php get_template_part( 'loop-meta' ); // Loads the loop-meta.php template. ?>
     
    		<?php get_template_part( 'loop' ); // Loads the loop.php template. ?>
     
    		<?php get_template_part( 'loop-nav' ); // Loads the loop-nav.php template. ?>
     
    	</div><!-- #content -->
     
    <?php get_footer(); // Loads the footer.php template. ?>
    #147572

    In reply to: change forum sidebar

    Robin W
    Moderator

    this is a widget logic problem, but try

    !is_page(‘page_name’) || (is_single() && !is_bbpress())

    if not, then try the support page, but is not well responded to

    https://wordpress.org/support/plugin/widget-logic

    #147570

    In reply to: change forum sidebar

    Mareva
    Participant

    Hi!
    Thank you for the !is_bbpress() code, that works perfectly with Widget Logic plugin.
    My trouble is: I’d like to specify more that one condition, e.g :
    !is_page(‘page_name’) || !is_bbpress()

    Unfortunatly, !is_bbpress code is not interpreted anymore when using this condition (the widget appears in the sidebar of all pages of the forum).
    Any idea about what I should do to make it work?

    #147550
    aborruso
    Participant

    Hi all,
    I know that there are several post about it, but I’m not able to find a solution for my forum.
    It’s password proteceted and I cannot send you any link.

    – I have WordPress 3.9.1 and bbpress 2.5.4
    – I use Twenty Eleven (I know it’s a bad theme for bbpress)
    – I have copied the content of /wp-content/plugins/bbpress/templates/default folder in my theme folder
    – I have edited all the php files of my /wp-content/themes/mytheme/bbpress folder and commented “get_sidebar()” function
    – I have created forum.php and bbpress.php file starting from page.php template and commented “get_sidebar()” function

    But I have always the sidebar (below bbpress).

    If I use this code

    function disable_all_widgets( $sidebars_widgets ) {       
        if ( function_exists('is_bbpress') ) {
            if (is_bbpress()) {
                $sidebars_widgets = array(false);
                remove_all_actions('bp_register_widgets');
                unregister_sidebar( 'bp_core_widgets' );
            }
        }
        return $sidebars_widgets;
    }
    
    add_filter('sidebars_widgets', 'disable_all_widgets', 1, 1);

    all the widgets disappear, but I have always meta links.

    I know I should change theme. Do you have some tips for this one?

    Thank you,

    Andrea

    Robin W
    Moderator

    getting it to display is easy !

    bbpress deosn’t use ‘the content’ function in its loops, so we need to hook to the bbpress content function which is bbp_get_reply_content

    So you just add a second filter after line 15, this then puts the ratings in the display

    {
        add_filter('the_content', 'spr_filter', 15);
    	add_filter ('bbp_get_reply_content', 'spr_filter') ;
    }

    Then the next bit of the plugins code looks at whether we have an individual post/page or are in a loop – a list of pages/posts.

    If just one (is_singular) then it will display the rating, and let you add one.
    If in a loop then it simply displays, and doesn’t let you alter, or that’s what I think it’s doing

    so to get it to understand that we’re in a list of replies (ie loop-single-reply) we test that we’re in bbpress

    so we add a test for bbpress into the first function viz

    foreach ($list as $list_)
        {
            if (is_bbpress() )
            {
                if ($options['position']=='before')
                {
                    $content=spr_rating().$content;
                }
                elseif ($options['position']=='after')
                {
                    $content .= spr_rating();
    			
                }
                break;
            }
    		if (is_singular($list_)&&$options['where_to_show'][$list_]&&$disable_rating!='1')

    Ok so that does the display (at the moment for both topics and replies, but that’s easily fixed later)

    What I can’t work out quite is why the amend doesn’t work. I think it is because the javascript/ajax is using spr_rate, but expects that to be part of $_post, but that’s may be failing as we are sort of in a bbpress loop at that stage, not in an individual post, so I dontl know what’s it looking for as post_id.

    Anyway I’m rubbish at ajax/js etc. so am just poking code in the hope of finding a fix.

    So that’s as far as I’ve got for now !!

    #147155
    Robin W
    Moderator

    you could try adding the following to your functions file

    add_filter( 'd4p_is_bbpress', '__return_true' );
    

    or seeing if your theme or other plugins are affecting

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, switch to a default theme such as twentytwelve, and see if this fixes.

    #145720
    koendb
    Participant

    Short question: How do I check if I’m on a page (or blog) from within ‘loop-single-reply.php’?

    WP 3.8.3
    bbpress 2.5.3
    URL: 24baby.nl

    Long question: I use bbpress for all my comments on articles and blogs: ‘Use a bbPress forum topic for comments on this post.’

    On my website this generates a first post along the lines of (my website is in Dutch): ‘This topic belongs to article <LINK>. Share your thoughts!’

    This text is visible both under the actual article and on the forums. While it’s a good way to explain the purpose of the thread on the forums, it’s confusing as the first reply on the actual article page. Because of that I don’t want to show this first reply on all my blog / page ‘pages’, but do want to show them on the forums.

    It’s fairly easy to remove the first reply within ‘loop-replies.php’, but I don’t know how to test whether I’m on the forums or not? Is_page doesn’t work, is_bbpress always returns true.

    nirgalo
    Participant

    Hi, I am using is_bbpress() in page.php to check whether I am in a bbPress context. It seems BuddyPress and bbPress are sharing the same profile page. Therefore, when the latter is being displayed, bbPress is being defined, and this triggers wrong behavior in my code. So, how can I check a bbPress or BuddyPress profile page is being displayed so I can fix my code? thx.

    #144758
    SooperGenius
    Participant

    is_bbpress() almost works. Thanks for the pointer there, by the way. I can’t see how I missed that function in all my searching. I failed my Google-fu obviously. My code now looks like this in the my-plugin.php file.

    function forum_lock_check($allcaps, $cap) {
    	if (function_exists("is_bbpress")) {
    		$is_bbpress = is_bbpress();
    	} else {
    		$is_bbpress = false;
    	}
    	
    	return $allcaps;
    }
    
    add_filter("user_has_cap", "forum_lock_check", 10, 3); 

    Here’s the funny part. (Funny = weird not Funny = haha) If I’m navigating to the main forums page (http://localhost/wordpress/forums/), then everything proceeds swimmingly. If I then navigate to a forum within the page (http://localhost/wordpress/forums/forum.forum-a) or to a thread within the forum (http://localhost/wordpress/forums/topic/post-1) I then get several of the following errors.

    Notice: Trying to get property of non-object in C:\xampp\htdocs\wordpress\wp-includes\query.php on line 3792
    
    Notice: Undefined property: WP_Query::$post in C:\xampp\htdocs\wordpress\wp-includes\query.php on line 3306

    Commenting out the “$is_ppbress = is_bbpress();” line removes the errors but I’ve got no idea why WordPress suddenly doesn’t like the code. Have you seen this before? What file is is_bbpress() in?

    Thanks, Robin.

    #144753
    Robin W
    Moderator

    is_bbpress()

    should do it I think.

    Otherwise bbpress has custom post types of forum, topic and reply.

    You should also consider disabling or modifying the bbpress search function, as otherwise searches will go forum wide, giving a backdoor.

    Good luck !

    #142479
    Robin W
    Moderator

    Think it’s as simple as

    is_bbpress()

    so try

    <div class="breadcrumbs">
        if(function_exists('bcn_display') && is_bbpress())
    {
    bcn_display();
    }</div>
    
    

    Haven’t checked the syntax, I’ll let you do that

    #142361

    In reply to: bbpress sidebar

    Robin W
    Moderator

    presume you are using the code is_bbpress() in your widget logic?

    #142345
    Robin W
    Moderator

    the answer is probably yes – a forum post is a post

    You might do better to install bbPress WP Tweaks Widget Logic plugin which gives you a forum specific sidebar

    alternately (or additionally) use widget logic where you can use code like is_bbpress()or the negative !is_bbpress()to control where widgets are shown

    cdonahue
    Participant

    Solved!

    Added this code to the bottom of my ‘page’ template, as that appears to be the default page for bbpress:

    if (is_bbpress()) {
    get_sidebar(forum);
    } ?>

    et voila.

    #141429
    piccart
    Participant

    Hi guys! sorry but I forgot to pin the notifications for this post so I just realized about your replies..

    it wasn’t very technical actually, but I think it depends a lot on the theme you have.

    if just added a conditional into the class of my page template main content and of the sidebar wrap:

    <?php if (is_bbpress() || is_page('forum')){ echo "forum_layout"; } ?>

    it will have to be added something like this:

    <div class="grid__item main float--left <?php if (is_bbpress() || is_page('forum')){ echo "forum_layout"; } ?>">

    then is all about css, so it depends on yours. but you should be able to override the interested divs, appending your .forum_layout class in this way:

    
    .grid__item.main.forum_layout {
    	width:76%;
    
    }
    
    .grid__item.sidebar.forum_layout {
    	width:24%;
    
    }

    then at the same you can override the normal layout fonts, colours, etc.. if something is not considering your new style, try adding !important in this way:

    width:24% !important;

    hope that’ll help! 😉

    #141184
    Stephen Edgar
    Keymaster

    There are numerous ways of doing this:

    You can use a conditional to check is_bbpress()

    Make some copies of your templates for example and make a copy of page.php file and rename it to bbpress.php and call a specific sidebar template eg bbpress-sidebar.php from your bbpress.php template.

    #141124

    In reply to: Thousands of revisions

    inspirationally
    Participant

    After deactivating all bbPress related Plugins, it still occured. Now I removed the functions.php and it seems to have stopped and I’m re-adding it one snippet after the other, but I always have to wait half an hour between each snippet to see if it continues. No idea how to test it “immediately”.

    It might be something about this part:

    //Remove bbPress Head on non bbPress sites

    add_action( 'wp_head', 'conditional_bbpress_head', 9 );
    function conditional_bbpress_head(){
    global $post;
    if( !is_bbpress() && !(is_home() && $_SERVER['SERVER_NAME'] == 'deppheads.com') && !(isset( $post->post_parent ) && $post->post_parent == "17123") )
    remove_action( 'wp_head', 'bbp_head' );
    }
    add_action( 'wp_enqueue_scripts', 'conditional_bbpress_scripts', 9 );
    function conditional_bbpress_scripts(){
    global $post;
    if( !is_bbpress() && !(is_home() && $_SERVER['SERVER_NAME'] == 'deppheads.com') && !(isset( $post->post_parent ) && $post->post_parent == "17123") )

    remove_action( 'wp_enqueue_scripts', 'bbp_enqueue_scripts' );
    }

    which I added because I have two domains running and just one little part under the domain deppheads is actually the forum, and I did not want all that bbPress code in all sites, especially not on my main site.
    Is that possible??

    #140556
    Robin W
    Moderator

    ok, plan b

    upload the “widget logic” plugin

    This lets you set widgets to appear in certain conditions

    Once uploaded, using your normal sidebar, you can set when a widget appears

    You’ll see a new box appear when you add/edit each widget saying “widget logic”. if you want it to appear on a forum page type

    is_bbpress()
    If you want the widget to appear on other pages, but not obn the forum page type

    !is_bbpress()
    so you login widget would have the logic

    is_bbpress()
    and appear only on forum pages

    If you didn’t want search on the forum page, you’d put

    !is_bbpress()
    on that widget and it will not appear

    #140334
    Sloppy Buns
    Participant

    I have worked part of this out and have implemented a is_bbpress format for forum pages so I can choose what sidebars to put on my forum pages however I am still not able to get sidebars to show up on profile or most popular topics.

    What I require is the is_ codex for these pages so I can write a script to place sidebars on these pages, I have found that the User profile has these html body classes:
    bbp-user-page single singular bbpress
    is_bbpress() does not work

    and Most Popular Topics:
    bbp-view bbpress

    This should be is_bbpress() however is_bbpress() does not work.

    Any help would be greatly appreciated.

    #140187
    Lynqoid
    Participant

    I’m not 100% on what is happening without seeing a site link, if you can find out where the coupons are being rendered then you could wrap them in if(!is_bbpress()) { }

    #140121

    In reply to: Hide Sidebar

    pmuktan
    Participant

    I pasted this code under main wp-config.php and side is gone.
    function disable_all_widgets( $sidebars_widgets ) {
    if ( function_exists(‘is_bbpress’) ) {
    if (is_bbpress()) {
    $sidebars_widgets = array(false);
    remove_all_actions(‘bp_register_widgets’);
    unregister_sidebar( ‘bp_core_widgets’ );
    }
    }
    return $sidebars_widgets;
    }

    add_filter(‘sidebars_widgets’, ‘disable_all_widgets’, 1, 1);

    My question is how do we remo Options like Topic Type and Topic Status ???

    Thank you.

    #140116

    In reply to: Hide Sidebar

    Robin W
    Moderator

    you can use ‘widget logic’ plugin to control what is shown in sidebars. for bbpress the logic is

    is_bbpress() to display and
    !is_bbpress() to hide

    or if you want a forum specific sidebar use ‘bbpress WP’ tweaks plugin.

    Profile images use the gravatar image see http://en.gravatar.com/ for details

    #140091
    Stephen Edgar
    Keymaster

    The main bbPress conditional tag is is_bbpress

    Try <?php if ( !is_bbpress ) : ?>

Viewing 25 results - 101 through 125 (of 191 total)
Skip to toolbar