Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'is_bbpress'

Viewing 25 results - 26 through 50 (of 190 total)
  • Author
    Search Results
  • #208405

    In reply to: sub topics not showing

    Robin W
    Moderator

    looked in pastebin.

    I’m not sure what this function is there for, except possibly to speed up site display if they have not accessed the forum part ?

    function dequeue_bbpress_style() {
        if ( class_exists('bbPress') ) {
          if ( ! is_bbpress() ) {
            wp_dequeue_style('bbp-default');
            wp_dequeue_style( 'bbp_private_replies_style');
            wp_dequeue_script('bbpress-editor');
          }
        }
    }
    add_action( 'wp_enqueue_scripts', 'dequeue_bbpress_style', 99 );

    it does tend to suggest that you have bbp_private_replies enabled ???

    David
    Participant

    Hi All,

    Is there a way to re-direct users that are logged in and land on the bbpress home location e.g /chat/ and re-direct them to a specific forum.

    E.g, logged in users visits mysite.com/chat, and it redirects them to mysite.com/chat/forum/support.

    i am using the code below found in the bbpress forums which re-directs guest to another page. It works great.

    /**
    * Redirect bbPress pages to registration page
    */
    function kleo_page_template_redirect()
    {
        //if not logged in and on a bp page except registration or activation
        if( ! is_user_logged_in() && is_bbpress() ) {
            wp_redirect( home_url( '/register/' ) );
            exit();
        }
    }
    add_action( 'template_redirect', 'kleo_page_template_redirect' );
    #205659

    In reply to: Child CSS

    hydrogriff
    Participant
    • Yes. W3TC with CSS minification.
    • Yoast SEO. As far as I know, it doesn’t interact with CSS files.
    • No.
    • No.

    Related change test: Tested with both screen and all. Did not work.

    Additional information:

    I have dequeued bbpress stylesheets for non-bbpress pages, using the below code.

    
    function dequeue_bbpress_style() {
        if ( class_exists('bbPress') ) {
          if ( ! is_bbpress() ) {
            wp_dequeue_style('bbp-default');
            wp_dequeue_style( 'bbp_private_replies_style');
            wp_dequeue_script('bbpress-editor');
          }
        }
    }
    add_action( 'wp_enqueue_scripts', 'dequeue_bbpress_style', 99 );
    

    I hope this helps.

    I also noted another issue where the replies were not loading (both topic replies and threaded replies) for any topics.

    #199326
    Robin W
    Moderator

    ok, for the participants trashing topics, install

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Topic/Reply Display items 17,18,& 19

    On the widgets, install
    the ‘widget logic plugin’, and on pages you want the widget, use

    is_bbpress()

    in the condition

    Mayeenul Islam
    Participant

    @robin-w
    Thank you for the feedback.

    It’s good that the issue is already addressed.

    But the question is not about dequeuing, but about enqueuing.
    Why not the bbPress core, enqueue the stylesheet only when is_bbpress() is true?

    #198079
    Robin W
    Moderator

    with widget logic you can call ‘is_bbpress’ that will determine if you are in a forum page

    #193629
    u_Oi
    Participant

    Hi @pauldlb

    Try this… Paste the follow code into function.php (Appearance – Editor – Functions.php)

    /* Remove SideBar From bbPress Profiles and Topics*/
    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);
    #190232
    Martin J
    Participant

    Actually…. the solution above wasn’t going to work because if breadcrumbs are enabled and someone clicks on the “Forum Home”, we lose all the effort. However, I finally found the conditional statement that works.

    This is only part of my code, but you can get the idea…I originally had this:

    
    // For Jetpack Portfolio heading
    elseif (is_post_type_archive()) :
    echo '<h1 id="bts-page-title">' . __( 'WordPress Themes', 'bts' ) . '</h1>';
    
    // For bbpress forum heading
    elseif (is_bbpress('forum')) :
    echo '<h1 id="bts-page-title">' . __( 'Support Forum', 'bts' ) . '</h1>';

    However, when I did this, it worked:

    // For bbpress forum heading
    elseif (is_bbpress('forum') || is_post_type_archive('forum') ) :
    echo '<h1 id="bts-page-title">' . __( 'Support Forum', 'bts' ) . '</h1>';
    
    // For Jetpack Portfolio heading
    elseif (is_post_type_archive()) :
    echo '<h1 id="bts-page-title">' . __( 'WordPress Themes', 'bts' ) . '</h1>';

    Now what is interesting, is that if I have the bbpress conditional “after” the Jetpack portfolio one, it would not work and the bbpress heading would be “WordPress Themes”. However, I had this sudden thought that perhaps there is a priority happening here, so I moved the bbpress conditional “before” the Jetpack one, and sure enough it works. The bbpress heading is “Support Forum” and the Jetpack portfolio is “WordPress Themes”.

    Something about the sequence caused an issue…what and why I do not know.

    #190229
    Martin J
    Participant

    Ah….found a fix for the above/last reply. I added the id of the page, so now the custom-bbpress.css only loads for bbpress and that page.

    if (is_bbpress() || is_page( 209 ) ) :

    #190228
    Martin J
    Participant

    Update: I had this in my functions:

    if ( is_bbpress()) {
    ….etc.

    But adding:

    is_page()

    Means that the custom-bbpress.css is going to load on all “pages”. A temporary solution, but not really the right solution.

    #190189
    Martin J
    Participant

    Hopefully I got the right forum here.

    I want to add a heading when on the “forums” archive home page of the bbpress forum. Right now I have this for jetpack’s portfolio…note this is just a snippet of my code:

    if (is_post_type_archive()) :
    echo '<h1 id="bts-page-title">' . __( 'WordPress Themes', 'bts' ) . '</h1>';

    …but the bbpress forum header area is loading that title as well. I’ve tried so many variations and conditionals, none work. I did manage to get the “forum” titles to show for individual forums with:

    elseif (is_bbpress('forum') ) :
    echo '<h1 id="bts-page-title">' . __( 'Support Forum', 'bts' ) . '</h1>';

    But does anyone have an idea how to get the conditional to show a custom header title for the bbpress home page?

    #189879
    Robin W
    Moderator

    As it’s above the title, then it’s before bbpress kicks in.

    you could try

    if (is_bbpress) {
    echo 'hello' ;
    }

    but may not work

    Or try to add something to your theme page.php or equivalent before the title
    Something like (this won’t work it’s just to start you off!)

    $array = (2925, 3567,4567) ;
    if (in_array ($page_id, $array)) {
    echo 'hello' ;
    }

    where 2925 etc are forum ID’s

    #188174
    morpheus978
    Participant

    Founded a workaround disabling yoast seo breadcrumbs in my theme files by using the conditional tag is_bbpress(). I will use the bbpress breadcrumbs in the forum pages.

    #187832
    aussiemike
    Participant

    Hello
    I am using the latest version of WP and bbPress with iThemese Builder theme.
    Through the theme functions I am able to show all parts of the forum on a particular theme layout, apart from the forum index page when the breadcrumb ‘forums’ link is clicked. This takes me back to the main template layout which does not have the forum wigdets as required on all forum pages.
    I also have the same issue with the search results.

    I have tried the following code but as I am not overly familiar with bbPress conditionals it does not solve the problem. I believe what I am look for is the correct information to go into this line:
    if ( is_bbpress() && in_category( ‘page’ ) )

    // create view for forums
    function custom_filter_category_layouts( $layout_id ) {
        if ( is_bbpress() && in_category( 'page' ) )
                return '599b46ad5fa63';
    
        return $layout_id;
    }
    add_filter( 'builder_filter_current_layout', 'custom_filter_category_layouts' );

    Any advice appreciated.

    Mike

    #187675
    Tony
    Participant

    I have two forums and I have two non-bbPress widgets. I’ve setup the widgets to show up on forum pages with the Widget Options plugin. Each of the forums need to show only the menu that pertains to it (match by state name). As of now, both widgets show up on both forum pages.

    Tried conditional tag: is_bbpress() with the page ID’s, but it doesn’t change anything. None of my researched plugins seem to have this feature figured out.

    Any ideas? Still fairly new to all this and not a coder so don’t have the best vernacular for troubleshooting.

    WP version: 4.8.2
    bbPress version: 2.5.14
    Site: https://selfdirectforum.com/forum/

    #184603
    ilovemetrics
    Participant

    Hoping someone has solved for this…

    I’m trying to make sure that all single topic pages are unique for SEO purposes. Currently, topics simply have the format “Forum – [Forum Name] – [Site Name]”. I want to prepend the topic so that the meta title tag format is “[Topic Name] – [Forum Name] – [Site Name]”.

    I do not want to use Yoast or any other plugin, as this should be a pretty simple change.

    The problem I am having is two fold:

    1. In functions.php, I am unable to use anything like is_bbpress() or bbp_is_single_topic() to tell if I am on a specific page.
    2. I am unable to get the bbPress topic title ahead of the pre_get_document_title() function so that I can prepend it into the meta header.

    Any help would be greatly appreciated. This is for a WordPress/BuddyPress/bbPress integration.

    Thanks in advance

    #181780
    Robin W
    Moderator

    sorry, missed that you were using wp tweaks which adds this sidebar. This plugin has no support, and doesn’t work with several themes by the look of it.

    suggest you try

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

    the logic for forum pages is

    is_bbpress()

    for a widget to only show on forum pages

    and to exclude from forum pages is

    !is_bbpress()

    #180502
    haddlyapis
    Participant

    Just to let you know that this issue was fixed by uninstalling the plugin “bbPress Login Register Links On Forum Topic Pages” and instead adding a login/logout link using the code provided here:

    Layout and functionality – Examples you can use

    and then adding code provided to make sure the links only appear in the forum and not the whole site:
    change line 3 to
    if ( is_user_logged_in() && is_bbpress() ) {

    and line 6 to

    elseif ( !is_user_logged_in() && is_bbpress() ) {

    #180470
    Robin W
    Moderator

    untested, but this should do it, come back if not

    change line 3 to

    if ( is_user_logged_in() && is_bbpress() ) {

    and line 6 to

    elseif ( !is_user_logged_in() && is_bbpress() ) {

    #179660
    u_Oi
    Participant

    HI,

    I used to have this code in my forum to make it full-width.

    /* Hide SideBar in bbPress Profiles and Topics*/
    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);

    Is there a way to apply full-width only for Forums and Topics (opened)?

    Thanks,

    #179446
    u_Oi
    Participant

    Try this code. Put it on the function.php

    /* Hide SideBar in bbPress Profiles and Topics*/
    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);

    You don’t say if You want the full-width to all pages or only to topics, forums, or profiles.

    Regards,

    #177754
    Themezly
    Participant

    2 months not even a hint and you know it is a bug. is_bbpress does not work as advised.

    #177740
    Robin W
    Moderator

    you can use the sidebar that your forum page is displaying – if it is showing one then read the rest of this, if not then come back !

    If you want specific items for bbpress and maybe others on other pages, then add https://en-gb.wordpress.org/plugins/widget-logic/

    and then use

    is_bbpress() as a condition for widgets to be shown and !is_bbpress() for widgets that you don’t want on forum pages, but do on others.

    #177705
    Robkk
    Moderator

    I was just pointing out that its possible that you may need to use another conditional as well if you did create a “forum page”.

    So you would possibly need another conditional for a user created “forum page”. If you didn’t already make sure that the “forum page” was set to have the same page slug as the default forums slug in your site set in Settings > Forums.

    An example of the additional conditional you would use would be is_page{1} where “1” is the specific page ID of your “forums page”.

    if (!is_bbpress() || is_page(1) ) {

    You can also use is_page(‘forums’) as well instead.

    https://developer.wordpress.org/reference/functions/is_page/

    I usually do not say use a “forums page” as it is not recommended during setup, but it could be useful to workaround bugs that I think usually happens when using a Genesis theme, but I guess use it until the bug is fixed in bbPress/Genesis. Well if there is still a bug.

    I would contact your theme developers support since you have a paid theme, and they can help you better since they understand the code in that specific theme, and only if you really want to dig into the code and modify it like your trying to do, or you can just use a plugin like Widget Logic to use a conditional to hide/display widgets depending on certain conditionals like is_bbpress() and is_page{}.

    #177607
    Robkk
    Moderator

    I am trying to remove that from showing on the forums page and instead show a a login for bbpress.

    This forum page you say, is it just the original forum index page at /forums, or is this a page that you inserted the forum index shortcode to create “forum page”??

    The is_bbpress() conditional may not work if you went the shortcode in a page route.

    Well unless you made sure the pages slug was the same slug as the forum root, but even with that I feel like that odd procedure could cause issues.

Viewing 25 results - 26 through 50 (of 190 total)
Skip to toolbar