Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'is_bbpress'

Viewing 25 results - 151 through 175 (of 191 total)
  • Author
    Search Results
  • #121109
    auco
    Participant

    Hi,

    apparently, there were some major changes in the bbPress version 2.2 update (from 2.1). I’m having massive problems to get bbPress 2.2 to work with my custom theme. It used to work nice with bbPress 2.1 (and it still does if I’m reverting to 2.1), but there’s just no more output from bbPress 2.2.

    Custom plugins don’t seem the cause, can’t see any difference in activating or deactivating them.

    The strange thing is, that there is no output from bbpress, so it’s not a question of style but a question of how to trigger bbpress output if not through content() ?

    I know that it’s a theme issue because it runs fine with the twentyeleven and the WPTouch theme.
    I already tried inspecting if it’s an excerpt() issue (it’s not) and checked the page for is_bbPress() to no avail.

    Is there a document that describes theming and theme integration for bbPress 2.2 or how to migrate from 2.1 to 2.2?

    Or has anyone else had this issue with your custom themes?
    I already checked this, but it didn’t help either: http://bbpress.org/forums/topic/non-functional-index-page-when-bbpress-2-1rc4-is-used-with-woothemes-canvas-5-05/

    Cheers!

    LabSecrets
    Participant

    Hi Gang,

    well…. this one through me for a loop today as well, when moving our WooThemes Canvas for bbPress & BuddyPress site for a test drive on bbPress 2.2 ( http://labsecrets.com/demo/canvas-commerce )

    The individual forums would work fine, but the main forum index was rendering what looked like a post excerpt, with everything jumbled into a single paragraph.

    Solution was actually rather simple. If you are using a child-theme in Canvas (you ARE using a child-theme I hope?? 😉  ) simply make a copy of the content-page.php file from parent, and put it into your child-theme folder.

    Next, change the entry div as shown, to modify the current conditional check to ALSO see if you are on a bbPress page. Without this extra bit, it assumes that you want the page to show the_excerpt() on every page other than single.php …. not true. We want full content on bbPress pages as well 😉

    <div class="entry">
    <?php
    /* If this is a bbPress page show full content not exerpt */
    if ( ! is_singular() && (! is_bbPress()) ) {
    the_excerpt();
    } else {
    the_content(__('Continue Reading &rarr;', 'woothemes') );
    }
    wp_link_pages( $page_link_args );
    ?>
    </div><!-- /.entry -->

    With this simple mod, all is well and now the native forums index works, and so does building a custom page with shortcode. Ta da!

    See: http://labsecrets.com/demo/canvas-commerce/forums/

    #120188
    shulamite8
    Participant

    Fatal error: Call to undefined function is_bbpress() in /home/jagudyje/public_html/wp-content/plugins/bbpress-members-only/init.php on line 129

    Try…

    if ( is_bbpress() ) { ... }
    #116113
    aaclayton
    Participant

    Thanks a bunch for sharing this snippet. It works perfectly when not conditioned. It’s not behaving nicely with the is_bbpress() conditional logic, so I’ll have to delve a bit deeper into the set of is_ functions you mentioned above, but I should be able to work something out. Thanks again for the help, and for the great forum software.

    #116104
    aaclayton
    Participant

    Sorry, I guess I’m not being very clear. The is_bbpress() function already seems to deliver the conditional logic I need. That (I don’t think) isn’t my problem. My problem is getting the proper syntax for removing the actions that add styles and scripts to the head area.

    remove_action ( 'bbp_enqueue_scripts' , 'enqueue_styles' );
    remove_action ( 'bbp_enqueue_scripts' , 'enqueue_scripts' );
    

    This doesn’t work, nor do some variants that I have tried. Could you suggest the proper syntax for removing the relevant actions, regardless of the conditioning logic employed?

    #116092
    aaclayton
    Participant

    I am still having this issue, unfortunately. Although I worked out enough of the technical details of bbPress 2.1 to port the plugin/templates/css over to the live (development) site.

    If it would be helpful to see what I’m talking about you can access http://tamrielfoundry.com with username: test, password: test.

    The bbpress CSS + some other scripts are being loaded in the head site-wide, and I can’t figure out the correct conditional syntax to remove them unless is_bbpress() is true.

    #116022
    aaclayton
    Participant

    Hey JJJ, thanks for the advice. I am using /css/bbpress.css in my theme, the trouble I’m having is actually getting the proper syntax for unhooking these elements when they aren’t needed.

    Essentially, what I’m trying to do is something like this:

    add_action( 'get_header', 'remove_bbpress_scripts' );
    function remove_bbpress_scripts() {
        if ( !is_bbpress() ) {
            remove_action ( 'bbp_enqueue_scripts' , 'enqueue_styles' );
            remove_action ( 'bbp_enqueue_scripts' , 'enqueue_scripts' );
        }
    }
    

    Something isn’t working with this syntax though, I suspect I need to prefix ‘enqueue_styles’ with something, but I’m not sure what the proper prefix is.

    #115957
    aaclayton
    Participant

    Hi bbPress community,

    Thank you for all your collective hard work on this great plugin. I’m working on an integration of the new 2.1 plugin into my own theme, and I had a question about scripts and styles that bbPress enqueues into the wp_head.

    In general, for plugins which are highly localized on the site (ones that only get used in very specific places), I prefer to conditionally enqueue styles and scripts to keep the head section of the main site relatively clean. bbPress currently initializes the following code site-wide:

    /** Scripts ***********************************************************/
    
    add_action( 'bbp_enqueue_scripts',      array( $this, 'enqueue_styles'        ) ); // Enqueue theme CSS
    add_action( 'bbp_enqueue_scripts',      array( $this, 'enqueue_scripts'       ) ); // Enqueue theme JS
    add_filter( 'bbp_enqueue_scripts',      array( $this, 'localize_topic_script' ) ); // Enqueue theme script localization
    add_action( 'bbp_head',                 array( $this, 'head_scripts'          ) ); // Output some extra JS in the 
    

    Normally I’m fairly handy with actions and filters in my functions.php file, but I’ve had a load of trouble getting these scripts to conditionally enqueue. Ideally, I would want to condition them on is_bbpress(). Can anyone offer a snippet to filter these unless is_bbpress() is true?

    Thanks in advance, and let me know if my question is unclear in any way.

    Andrew

    #115192
    pimarts
    Participant

    I posted this in another topic, this works for me:

    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);
    

    But that’s because I haven’t looked into custom themes yet. Did everything with functions and CSS at the moment.

    #114991
    pimarts
    Participant

    You could try something like this (for an install that also has BuddyPress):

    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);
    
    #114968
    viktora
    Member

    It looks like this is my solo topic.:-) So I continue contributing. Here is my progress in resolving the isue described above.

    I have created bbpress-extras directory in MYTHEME directory. All files from /wp-content/plugins/bbpress/bbp-theme-compat/extras were copied into this directory. Than I edited bbpress-functions.php (copied to MYTHEME directory). Following code looks to be promising

    function bbpress_custom_template() {
    if ( is_bbpress() ) {
    require_once ( 'bbpress-extras/page-front-forums.php');
    exit;   
    }
    }
    add_action('template_redirect', 'bbpress_custom_template');
    

    This is the result: http://poradci-sobe.cz/forums/

    This looks like this is the way how my custom template files can be stopped to be ignored by bbpress. At least the first file I am testing – page-front-forums.php. I will try to make the condition more precize and to create special condition for each template file I want to use.

    Does anybody know, why this approach creates as many forum lists as the number of forum is?? Each forum lists is the same except forum name is different. I would expect there will be only one forum lists without any name.

    I am looking for JJJs answer saying “this is a very poor solution”. I am trying my best. Sorry for that.:-)

    • This reply was modified 11 years, 9 months ago by viktora.
    #114125
    devpaq
    Participant

    For anyone else interested, I placed it in the main WP theme header and just wrapped it with is_bbpress()

    That allowed me to check if they were on bbpress and not logged in to display the login screen, otherwise continue as it should.

    #45002

    I have two separate headers for my customized skeleton theme, header.php and header-page.php. Is there a way I can call header-page.php on my forums page for bbpress? I tried using:

    if ( is_front_page() ) :

    get_header();

    elseif ( is_bbpress() ) :

    get_header(‘page’);

    else :

    get_header(‘page’);

    in my index.php page, but it didn’t work. Is there another way to do this?

    Thanks.

    #113555
    pimarts
    Participant

    I don’t know if this is of any help but to get what I did at SWNK (http://www.swnk.org/forums/) I added the following code to my functions.php:

    function disable_all_widgets( $sidebars_widgets ) {

    // if ( bbp_is_forum() ) {

    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);

    Then I added some CSS to put the login widget above the forum.

    #113554

    You will need to do some custom development on your end. This isn’t implemented in core (at least not yet) because at the moment each theme/framework handles their layout options differently – so there is no easy way to cover them all.

    You can probably use the code in https://wordpress.org/extend/plugins/bbpress-genesis-extend/ as an example.

    Basically you will want to check for is_bbpress() and if that comes back true then run your code that forces the full width layout.

    There are several different things you can do.

    I would recommend inserting this information by using hooks that bbPress put in place. Unfortunately there is no “master list” of the available hooks, so you have to dig in bbPress and find the best one. It’s very do-able but will take some trial and error.

    Your other option would be to approach things like you are doing now. I would use bbPress conditionals instead of is_page(). Here are a few of the conditionals available:

    bbp_is_single_forum()
    bbp_is_single_topic()
    bbp_is_topic_edit()
    bbp_is_topic_merge()
    bbp_is_topic_split()
    bbp_is_single_reply()
    bbp_is_reply_edit()
    bbp_is_reply_edit()
    bbp_is_single_view()
    bbp_is_single_user_edit()
    bbp_is_single_user()
    bbp_is_user_home()
    bbp_is_subscriptions()
    bbp_is_favorites()
    bbp_is_topics_created()
    is_bbpress() (this is all of the above wrapped in one)

    #111975

    Try adding a check for bbPress, such as

    add_action( 'bbp_ready', 'ja_login_detect' );
    function ja_login_detect() {
    if ( is_bbpress() ) {
    include_once "/dap/dap-config.php";

    if ( !Dap_Session::isLoggedIn() )
    header( "Location: /dap/login.php" )
    }
    }

    #111969

    You are going to have to wrap it in something that checks for bbPress.

    Similar to:

    if ( is_bbpress() ) {
    include_once "/dap/dap-config.php";

    if( !Dap_Session::isLoggedIn() ) {
    header("Location: /dap/login.php");
    exit;
    }
    }

    However it’s going to likely take more polish than that.

    #110810
    benfrain
    Member

    Hi Raphaelsuzuki – no, making a page (with full width template) and setting it as the base slug doesn’t work I’m afraid.

    I’m not using TwentyTen, I’m using a child theme based on Thematic. I ended up just filtering the sidebar away with the following in my main theme’s functions.php:

    function remove_sidebar() {
    if(function_exists('is_bbpress') && is_bbpress()){
    return FALSE;
    } else {
    return TRUE;
    }
    }
    add_filter('thematic_sidebar', 'remove_sidebar');

    Hope that helps someone in future.

    #110077
    Gautam Gupta
    Participant

    Thanks for the share! You might want to use is_bbpress() function (found in bbp-includes/bbp-common-template.php instead of $uri = $_SERVER['REQUEST_URI']; if ( strpos($uri,'YOUR-FORUM-BASE') !== false ) {

    I have wrapped your code blocks in backticks for easier reading. :)

    #40454
    Anointed
    Participant

    I’m looking for something like is_bbpress(), but one that only fires if on the forum homepage. Is there such a conditional?

    i.e.

    if is_bbpress_forum_home() …. will allow me to add/subtract functionality from the forum homepage no matter where it is located.

    Trying to do something like:

    <?php if ( $page = bbp_get_page_by_path( $bbp->root_slug ) ) : ?>

    <?php _e( 'Forums', 'bbpress' ); ?>

    <?php else : ?>

    <?php bbp_forum_title(); ?>

    <?php endif; ?>

    #40169
    common8308
    Participant

    I was fixing a certain existing WP plugin to my taste to make it work in bbpress, and experienced comments_open() function is not stably working in bbpress.

    In most cases it returned true in open topics/replies. but in less than 5% cases it returned false although the topic was open and making replies were available..

    I just replaced comments_open() function to (is_user_logged_in() && is_bbpress()) and it worked fine. (Thank you for this function!)

    I don’t think it’s not much important in using bbpress, but just curious to know how comments_open() function works in bbpress if it’s not too complicated.

    #109225
    Anointed
    Participant

    I would try is_bbpress() from the bbp-common-template.php functions file.

    #109091
    Clicknathan
    Participant

    Yay, there is! And it’s actually so obvious I should be ashamed for posting this question.

    is_bbpress

    More info in bbp-includes/bbp-common-template.php

Viewing 25 results - 151 through 175 (of 191 total)
Skip to toolbar