Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'is_bbpress'

Viewing 16 results - 176 through 191 (of 191 total)
  • Author
    Search Results
  • #108611
    al3xander
    Member

    Hey John,

    sorry to re-open this thread.

    i just found something interesting, the »tags« page (ie: https://bbpress.org/forums/tags/stylesheet) is the only one which doesn’t recognize the is_bbpress() check.

    #108609

    Good question. The main reason it loads all the time is shortcodes. bbPress doesn’t have any way to know that the_content contains a shortcode when the head of the page is being processed, so including it all the time is the safest bet for most people.

    If you want to dial in your installation, you can wrap the CSS enqueue in a is_bbpress() check. is_bbpress() returns true when WordPress is loading up a bbPress specific page.

    #107984
    simplethemes.com
    Participant

    You should be able to add any widget to the ‘Forum Sidebar’ location.

    If bbPress is installed, this widget location gets registered:

    http://screencast.com/t/axXP7yykY

    If it isn’t showing up, make sure it isn’t commented out in the forum templates you want it to show in. I only enabled it in the templates I felt were necessary (like the member pages).

    On some of my forum pages I wanted a wide page, but you can certainly change it.

    For example, to change the forum home page template, open archive-forum.php in the theme editor and just uncomment this line:

    // get_sidebar('bbpress');

    Then, in functions.php find this line:

    // force wide on bbPress pages
    if (is_bbpress()) {
    $columns = 'sixteen';
    }

    and change ‘sixteen’ to ‘eleven’ to accommodate the sidebar.

    #107295
    #107294

    Agreed. Add a ticket on trac?

    #39134

    is_bbpress() function currently doesn’t account for tag pages – http://dev.example.net/forums/topic-tag/testing/

    Is it by design? I think it should account tag pages as they basically are bbPress pages.

    #107099
    pimarts
    Participant

    I run a combination of bbPress & Buddypress and this worked for me, I did put the following code in functions.php:

    function disable_all_widgets( $sidebars_widgets ) {

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

    This removed all widgets aside from the user login, but that’s quite handy to be present at the forum pages. I put that on top of the forums with CSS.

    #70443
    ganzua
    Member

    Thanks for the code John :) Half the results but it actually could solve the 404 problem.

    However, adding a get_settings(‘home’) to the search form makes this search;

    /wordpress/wordpress/bbpress/?s=

    I had in mind that perhaps anybody developed a wordpress plugin that could search both, wp and bb and then display the results, first all the wp entries and next all the bb entries.

    Or maybe a conditional in the wp template where I placed wp searcher; first the wp searcher with anything similar to John’s get_settings(‘home’) and then a conditional; if this is bbpress then use bbpress searcher and append the results. I already have a function to create bb conditionals in wp;

    function is_bbpress() {
    global $bb;
    return $bb ? true : false;
    }

    There is another search plugin for bbPress that appends a WordPress search to the bbPress search.

    I wanted all the contrary :) a wp plugin that appends bb results at the end of the search.

    BTW, after finding the searcher issue I realized that 404 templates need integration too.

    #60532
    fel64
    Member

    No problem. :)

    Option #3 was a throwaway possibility, not really meant for actual use as it’s rather silly.

    whatever && !is_bbpress() means, literally, that whatever has to be true AND is_bbpress() is not true. The ! operator inverts the boolean meaning, so true becomes false and vice versa. If is_bbpress() is true, ! makes it read as false. If false, it makes it read as true.

    By the way, the backtick ` that indicates code is on the top left button on most English and European characters. :)

    #60530
    ganzua
    Member

    oops! sorry, I didn’t define what happens whe is_bbpress(), I just exclude it.

    now it is working;

    <?php if (

    is_page()

    )

    { ?>

    <!– one ad block –>

    <?php } elseif (

    is_single()

    && !is_bbpress()

    )

    { ?>

    <!– two ad blocks –>

    <?php } elseif (is_bbpress()

    )

    { ?>

    <!– half ad block –>

    <?php } else

    { ?>

    <!– no ads –>

    <?php } ?>

    #60529
    ganzua
    Member

    Well, more or less this is working but now bbpress goes to the last “else” statement and I don’t know why;

    <?php if ( is_page() )

    { ?>

    <!– one ad block –>

    <?php } elseif ( is_single() && !is_bbpress() )

    { ?>

    <!– two ad blocks –>

    <?php } else

    { ?>

    <!– no ads –>

    <?php } ?>

    I haven’t try your third option yet because I didn’t understand quite enough.

    #60528
    ganzua
    Member

    Thanks again fel64,

    I tried the second one because it seemed the easiest to me :) and I think it is working ok.

    This -> ‘ && !is_bbpress() ‘ means “exclude bbpress”, doesn’t it?

    The first one, ” elseif “, is quite interesting -> in my wp custom theme, I turned index.php into a cms which displays what’s new in the whole web, and I created a static page called “blog” to display the “blog” itself.

    Well, with this configuration, whenever you make a is_home statement , the function points to the static page I created and called “blog” and I can’t find the way to make the function to point to my custom index.php main page. Perhaps because the static page I called “blog” has the loop?

    #60527
    fel64
    Member

    Actually the function works just fine, you’re just expecting it to work differently. Try using different flow control or rewriting your logic.

    if( blah_is_true() ) {

    } elseif( foo_is_true() ) {

    } elseif( third_thing_is_true() ) {

    } else {
    // default
    }

    The elseifs mean that if a previous if statement was true, none of the successive ones will be tried. That way, if it is bb, it won’t even check if it’s single or a page.

    Alternatively,

    if( ( is_single() || is_page() ) && !is_bbpress() ) {

    }

    will work just fine.

    If you’ve integrated bb into wp that way, of course some of the WP template tags will work that way. If you wanted everything else to return false when you loaded bb, you’d have to do this:

    function adjust_flags_to_bb() {
    global $wp_query;
    $wp_query->init_query_flags();
    }
    add_action('bb_init', 'adjust_flags_to_bb', 999);
    //not sure if that's the right action, but meh

    but that’s really quite unnecessary.

    #60526
    ganzua
    Member

    “What’s the actual problem? How are you using it, what do you expect it to do, what exactly is it doing?”

    ->

    In my wp-bb integration, bbpress is integrated in wordpress and the forum uses the wordpress sidebar. I want to insert advertising blocks in the free space that I have in the bottom of the sidebar.

    I’m trying to use wp conditional tags to display different ad blocks because in some pages I have space enough for one block, and in other pages I have space for two or three blocks.

    In wp single pages I can display at least two 120×600 blocks so I’m using is_single() but I realized that these blocks are appearing in the bbpress forum too! and I just have no space enough for them so I want to change them for a 125×125 block when the forum is displayed or perhaps I could remove all ads when bbpress displayed.

    So “How are you using it” -> after copy/pasting your function in my theme functions file, I inserted this code in my sidebar;

    <?php if (is_bbpress()

    || is_archive()

    ) { ?>

    <!– 125×125 block –>

    <?php } ?>

    <?php if (is_single()

    || is_page()

    ) { ?>

    <!– 160×600 block –>

    <?php } ?>

    “what do you expect it to do” -> showing different ads blocks in the sidebar when bbpress displayed

    “what exactly is it doing” -> is showing the blocks I set for is_single ()

    #60523
    fel64
    Member

    Might have asked what you wanted straight away. :/ So open your theme’s functions.php and add this:

    function is_bbpress() {
    global $bb;
    return $bb ? true : false;
    }

    Off the top of my head, but should work anyway. Try it.

    #60522
    ganzua
    Member

    Hey fel64!

    Thanks for the answer. Do you know if is it possible to copy these functions in your wordpress theme functions file?

    In fact I only need to define one conditional tag; is_bbpress(), so I can display different advertising blocks in the wordpress sidebar when loading bbpress.

Viewing 16 results - 176 through 191 (of 191 total)
Skip to toolbar