Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'is_bbpress'

Viewing 25 results - 51 through 75 (of 191 total)
  • Author
    Search Results
  • #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.

    #177603
    crayc
    Participant

    I finally got it to go away like this

    if (is_bbpress ())

    if ( is_active_sidebar( ‘social-icons’ ) || is_active_sidebar( ‘click-here’ ) || is_active_sidebar( ‘split-sidebar-left’ ) || is_active_sidebar( ‘split-sidebar-right’ )) {

    but it removes it sitewide

    #177601
    Robin W
    Moderator

    ok, so you need to determine if it is the is_bbpress that is the issue. If you just have the other code does it work – ie is the issue with the other code or the conditional?

    #177600
    crayc
    Participant

    thanks. I tried that and it did not work.
    I also tried
    if (!is_bbpress ())
    remove_action ( ‘genesis_after_header’, ‘the_411_extras’, ‘genesis_after_sidebar_widget_area’ );
    if ( is_active_sidebar( ‘social-icons’ ) || is_active_sidebar( ‘click-here’ ) || is_active_sidebar( ‘split-sidebar-left’ ) || is_active_sidebar( ‘split-sidebar-right’ )) {

    and
    if (!is_bbpress (‘forums’))

    if ( is_active_sidebar( ‘social-icons’ ) || is_active_sidebar( ‘click-here’ ) || is_active_sidebar( ‘split-sidebar-left’ ) || is_active_sidebar( ‘split-sidebar-right’ )) {

    with and without the forums part. nothing seems to remove it.

    #177594
    Robin W
    Moderator

    ok, thanks for confirming.

    Without spending considerable time testing, why not just take out that entire section for bbpress (and if needed juts put back the bits you want) eg

    //* Hook social icons and click here widget areas
     add_action( ‘genesis_after_header’, ‘the_411_extras’, ‘genesis_after_sidebar_widget_area’ );
    
     function the_411_extras() {
    if (!is_bbpress {
    if ( is_active_sidebar( ‘social-icons’ ) || is_active_sidebar( ‘click-here’ ) || is_active_sidebar( ‘split-sidebar-left’ ) || is_active_sidebar( ‘split-sidebar-right’ )) {
    
    echo ‘<div class=”site-extras”>’;
    
    genesis_widget_area( ‘social-icons’, array(
     ‘before’ => ‘<div class=”social-icons”>’,
     ‘after’ => ‘</div>’
     ) );
    
    genesis_widget_area( ‘click-here’, array(
     ‘before’ => ‘<div class=”click-here”>’,
     ‘after’ => ‘</div>’
     ) );
     genesis_widget_area( ‘split-sidebar-left’, array(
     ‘before’ => ‘<div class=”split-sidebar-left”>’,
     ‘after’ => ‘</div>’,
     ) );
     genesis_widget_area( ‘split-sidebar-right’, array(
     ‘before’ => ‘<div class=”split-sidebar-right”>’,
     ‘after’ => ‘</div>’,
     ) );
    
    echo ‘</div>’;
    
    }
     
    
    }
    
    }

    I’m also not sure why your add action has two functions

    add_action( ‘genesis_after_header’, ‘the_411_extras’, ‘genesis_after_sidebar_widget_area’ );

    all the coding I have ever done has one, and then maybe some arguments on priority etc.

    #177585
    Robin W
    Moderator

    so did you try it as that, or as
    if (is_bbpress( ‘forums’ ) ) {

    is_bbpress doesn’t take arguments

    #177568
    Robin W
    Moderator

    I tried the If conditional tag on there but it does not seem to work.

    do you mean

    if (is_bbpress() )…

    ?

    #177566
    crayc
    Participant

    Hello, I am using genesis theme the-411 which has no sidebars just a fixed widget area to the right showing social icons. The site is forced full width but the container sit at about 800px I am trying to remove that from showing on the forums page and instead show a a login for bbpress. Not sure how to go about doing this. I tried the If conditional tag on there but it does not seem to work.

    here is the code
    //* Hook social icons and click here widget areas
    add_action( ‘genesis_after_header’, ‘the_411_extras’, ‘genesis_after_sidebar_widget_area’ );
    function the_411_extras() {

    if ( is_active_sidebar( ‘social-icons’ ) || is_active_sidebar( ‘click-here’ ) || is_active_sidebar( ‘split-sidebar-left’ ) || is_active_sidebar( ‘split-sidebar-right’ )) {

    echo ‘<div class=”site-extras”>’;

    genesis_widget_area( ‘social-icons’, array(
    ‘before’ => ‘<div class=”social-icons”>’,
    ‘after’ => ‘</div>’
    ) );

    genesis_widget_area( ‘click-here’, array(
    ‘before’ => ‘<div class=”click-here”>’,
    ‘after’ => ‘</div>’
    ) );
    genesis_widget_area( ‘split-sidebar-left’, array(
    ‘before’ => ‘<div class=”split-sidebar-left”>’,
    ‘after’ => ‘</div>’,
    ) );
    genesis_widget_area( ‘split-sidebar-right’, array(
    ‘before’ => ‘<div class=”split-sidebar-right”>’,
    ‘after’ => ‘</div>’,
    ) );

    echo ‘</div>’;

    if (is_bbpress( ‘forums’ ) ) {
    /** Remove default sidebar */
    remove_action( ‘genesis_after_sidebar_widget_area’ );
    }

    }

    }

    I added the split right and left, but I only use the right for search box. Thanks!

    Robkk
    Moderator

    Or another possible pinch point is the Tool’s kits option to remove css from non bbpress pages

    the bbp toolkit plugin just dequeues the bbPress default stylesheet if the page is not a bbPress one. Here is the function for that feature.

    function bbptoolkit_unqueue_bbp_scripts() {
    	if( ! is_bbpress() ) {
    		$bbptoolkit_rem_defstyle = get_option('bbptoolkit-rem-defstyle', false);
    		if ($bbptoolkit_rem_defstyle) {
    			wp_dequeue_style('bbp-default');
    			wp_dequeue_style('bbp-default-rtl');
    		}
    	}
    }
    add_action( 'bbp_enqueue_scripts', 'bbptoolkit_unqueue_bbp_scripts', 15 );

    This may not be the conflict as I think robins plugin doesn’t mess with the default stylesheet in bbPress. So it might be something else.

    #175755
    Themezly
    Participant

    I am working on a theme and need to deque all bbpress scripts and enque my own if I am on forum pages. This is what I used to start with

    	if( !is_admin() ){ 
    		/**
    		 *	Replace bbpress style with our own
    		 *  @internal
    		 */
    		function _thz_action_bbpress_style() {
    			
    			wp_dequeue_style( 'bbp-default' );
    			
    			if (is_bbpress()){
    				
    				wp_enqueue_style( THEME_NAME. '-bbpress' );	
    		
    			}
    			
    	
    		}
    		
    		if (function_exists('is_bbpress')){
    			add_action( 'wp_enqueue_scripts', '_thz_action_bbpress_style' );
    		}
    		
    		
    	
    	}

    issue with this is that is_bbpress() is not recognized on pages that use any bbpress shortcodes like

    [bbp-forum-index]

    Can someone please provide a working conditional that runs only on forum pages and not throughout the whole site. Thnx!

    #173470
    tech55541
    Participant

    Hello,
    Couldn’t you still use functions.php with this code to restrict it to BBPress.

    if ( is_bbPress() ):

    Makes since to me.

    Thanks.

    #172635
    awal16
    Participant

    I followed the steps, but the right sidebar doesn’t show up, the main-sidebar is still vissible.

    My code in the functions.php:

    
    function rkk_widgets_init(){
    	register_sidebar(array(
    		'id' => 'bbp-sidebar',
    		'name' => __( 'Forum sidebar', 'rkk' ),
    		'description' => __( 'Sidebar voor het forum', 'rkk' ),
    		'before_widget' => '<div id="%1$s" class="forum-widget %2$s">',
    		'after_widget' => '</div>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>'
    	));
    }
    add_action('widgets_init', 'rkk_widgets_init');
    

    The code in the sidebar.php:

    
    <?php if (is_active_sidebar('main-sidebar') && !is_bbpress()) : ?>
    	<div id="secondary" class="widget-area" role="complementary">
    		<?php dynamic_sidebar('main-sidebar'); ?>
    	</div><!-- .widget-area -->
    	
    <?php elseif (is_active_sidebar('bbp-sidebar') && is_bbpress()) : ?>
    
    	<div id="secondary" class="widget-area" role="complementary">
    		<?php dynamic_sidebar('bbp-sidebar'); ?>
    	</div><!-- .widget-area -->
    <?php endif; ?>
    

    In the backend, the forum widget does appear, and I can add Widgets to it. Only on the front-end, on forum pages, he doesn’t show the right sidebar.

    #172424
    Robin W
    Moderator

    just seen this !

    https://wordpress.org/plugins/woo-login-redirect/

    if you download and unwrap it you’ll see two functions, one the filter above !

    Depending on your site it might take a

    if (is_bbpress()) $redirect = xxtype statement on line 71

    #171835
    Adri Oosterwijk
    Participant

    Hi all,
    I think I got it worked out together with Otto and Tia over at WPML.
    You can have a look at it at those two topics:

    https://wpml.org/forums/topic/multiple-site-languages-but-just-a-bbpress-forum-in-english/
    https://wpml.org/forums/topic/bbpress-breadcrumbs-how-to-localize-and-point-to-the-right-page/

    BTW I hide the language switcher(s) on the topics pages by adding this piece of code in my header file

    <?php if (!is_bbpress()) {
    do_action('icl_language_selector'); 
    } ?>

    and this in my footer.php

    <?php if (!is_bbpress()) {
    do_action(‘wpml_footer_language_selector’);
    } ?>

    I hope it helps you as well.

    Regards,

    Adri

    Robin W
    Moderator

    ok, @membershipsite101

    This old link talks about using templates

    https://optimizepress.zendesk.com/hc/en-us/community/posts/200815558-OptimizePress-2-bbPress-Total-Mess-Let-s-get-this-fixed-now-

    and suggests putting

    if (is_bbpress()) { include 'bbpress.php'; exit; }
    

    on top of index.php (for the forum-index) and single.php (for the topics) and then style the bbpress.php in the /themes/optimizePressTheme/ /themes/1/ (or whatever OP2 blog-theme you’re using) to your liking.

    If you’re a bit techy, might be worth looking at.

    #171157
    Andrew Tibbetts
    Participant

    Thanks, Stephen.
    Ok, so, Query Monitor is telling me that topic pages are returning true on a bunch of is_s:

    is_page()
    is_singular()
    is_bbpress()
    bbp_is_single_topic()
    is_buddypress()
    bp_is_group()
    bp_is_group_forum_topic()
    bp_is_group_single()
    bp_is_groups_component()
    bp_is_single_item()

    But, when i put echo is_singular( bbp_get_forum_post_type() ) ? 'yes' : 'no'; exit; on line 255 of bbpress/includes/common/template.php inside bbp_is_single_topic(), I get a white page that says “no”.

    #169177
    32diego
    Participant

    For anyone interested this is the fix

    This is actually a bbPress issue with the singular.php template which was introduced in WordPress 4.3 but bbPress doesn’t support it yet. It looks like it has been fixed in core already – https://bbpress.trac.wordpress.org/changeset/5950 – but the update hasn’t been released yet.

    If you add the following code to the top of your index.php for your theme it will provide a temp fix:

    // bbPress fix while they update things…
    if ( function_exists( ‘is_bbpress’ ) && is_bbpress() ) {
    get_template_part( ‘singular’ );
    return;
    }

    #167643
    TiPi64
    Participant

    Hello there.

    I want to use conditionnal tags in order to display some details. The main page (frontpage) of the forum uses a WordPress page but doesn’t keep the content nor the details (SEO details such as meta description).

    I want to add some details (content and meta values). I want to make some conditionnal tags and I need to know how I can do.

    I checked this forum and Google to know if I can use, with an if, is_bbpress or is_frontpage, but no answers solved my problem.

    How can I force anything to be displayed where I want in the main page of the forum? Thanks for the help.

    Regards,

    Thibaut.

    #167202
    Robkk
    Moderator

    You did try it like this right??

    if(is_bbpress() && $args->menu->slug == 'sub_header_menu')

    If it still doesn’t work you can try finding the menu location in your theme, which might most likely be in the functions.php file, but it could be different depending on the theme. You would spot by the register nav menu function like what is listed in this page.

    https://codex.wordpress.org/Function_Reference/register_nav_menus

    If you have a free theme I could check it out and get the arguments you need.

    #167198
    Robkk
    Moderator

    I guess you can try this code instead to see if it works any. I guess I can can also just check out to see if the custom script file name changed. I am using an older version of Divi 2.4 for testing so it could be a possibility.

    You can contact me here if you want me to check it out on your site later.
    Contact

    add_action( 'wp_print_scripts', 'rkk_reply_threading_divi' );
    
    function rkk_reply_threading_divi() {
    
        if( is_bbpress() && bbp_is_single_topic() ) {
            wp_dequeue_script( 'divi-custom-script' );
        }
    }
    #167197
    mica123
    Participant

    When I use this code without the
    if(is_bbpress() && $args->theme_location == 'sub-header-menu')

    it works but I get the links on both menus. Below is the code I tried to use for the second menu only – the second menu is called Logins – I tried to use both sub-header-menu or logins.
    I tried your suggestion with both as well.

    add_filter( 'wp_nav_menu_items', 'my_nav_menu_login_link' );
    function my_nav_menu_login_link($menu) {
        //uncomment the next line if you only want login on bbpress pages
    
       if(is_bbpress() && $args->theme_location == 'sub-header-menu')
        if (is_user_logged_in()) {
            //set the $url on the next line to the page you want users to go back to when they logout
            $url = '$url = 'http://www.mysite.com/forums';
            $url2=wp_logout_url($url) ;
            $loginlink = '<li><a title="Logout" href="'.$url2.'">Logout</a></li>';
            }
        else {
            $current_user = wp_get_current_user();
            $user=$current_user->user_login ;
            //set $page on the next line = the permalink for your login page
            $page=''login' ;
            $loginlink = '<li><a href="/'.$page.'/">Login</a></li>';
                    }
         //uncomment out the next lines if you only want login on bbpress pages
       }
        else {
       $loginlink="" ;
          }
            $menu = $menu . $loginlink;
            return $menu;
            }
    #167195
    klink
    Participant

    Thank you @robkk It didn’t work, but I only have a basic understanding, so I’m not exactly sure if I put the code in the right place in the file. Here is what my functions.php file looks like with the code you provided.

    <?php
    
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array('parent-style')
        );
    }
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    
    register_nav_menus( array(
    	'primary-menu'   => __( 'Primary Menu', 'Divi' ),
    	'profile-menu'   => __( 'Profile Menu', 'Divi' ),
    	'secondary-menu' => __( 'Secondary Menu', 'Divi' ),
    	'footer-menu'    => __( 'Footer Menu', 'Divi' ),
    ) );
    add_action( 'wp_print_scripts', 'rkk_reply_threading_divi' );
    
    function rkk_reply_threading_divi() {
    
        if( function_exists( 'is_bbpress' ) && bbp_is_single_topic() && bbp_thread_replies() ) 
    
    {
            wp_dequeue_script( 'divi-custom-script' );
        }
    }
    ?>
    
    #167153
    mica123
    Participant

    Hello

    After experimenting with all your suggestions I think I would like to use the code from
    https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/ #11.This redirects both logged in and not logged in users to specific pages which is what I want.
    This works partially – I am trying to attach it to my second menu – not the primary menu but whathever I try it doesn’t work. If I leave the code as it is, it displays the links on both menus. I tried to use
    if ($args->theme_location == 'sub-header-menu')
    in various places such as:
    if(is_bbpress() && $args->theme_location == 'sub-header-menu')

    I would need this for both logged in and not logged in users.
    Thank you very much for your patience. I hope you can help.

    #167086
    Robkk
    Moderator

    It is just a conflicting piece of javascript somewhere in the file. If they already have a fix somewhere in that file for comment threading then something similar may need to be done to bbPress reply threading since both their scripts are very similar.

    Try this custom php code snippet. Place it in your child themes functions.php file or in a functionality plugin.

    add_action( 'wp_print_scripts', 'rkk_reply_threading_divi' );
    
    function rkk_reply_threading_divi() {
    
        if( function_exists( 'is_bbpress' ) && bbp_is_single_topic() && bbp_thread_replies() ) {
            wp_dequeue_script( 'divi-custom-script' );
        }
    }
    Mei Ling
    Participant

    If your theme gets a breadcrumb, then disable Yoast’s one. You may have two breadcrumb:

    First ==> WordPress
    Second==> BBPress

    You do this:

    */
    function tempera_breadcrumbs1() {
    	$temperas= tempera_get_theme_options();
    	foreach ($temperas as $key => $value) { ${"$key"} = $value ; }
    	global $post;
    	$separator = "<i class='icon-angle-right'></i> ";
    	
     if( !is_bbpress()){	
    	
    	if (is_page() && !is_front_page() || is_single() || is_category() || is_archive()) {
    		echo '<div class="breadcrumbs">';
            echo '<a href="'.home_url().'"><i class="icon-homebread"></i></a>'.$separator ;
            if (is_page()) {
    
    			$ancestors = get_post_ancestors($post);
                if ($ancestors) {
    
    				$ancestors = array_reverse($ancestors);
                    foreach ($ancestors as $crumb) {
                        echo '<a href="'.get_permalink($crumb).'">'.get_the_title($crumb).$separator.'</a>';
                    }
                }
            }
            if (is_single()) {
    			if (has_category()) {
    				$category = get_the_category();
    				echo '<a href="'.get_category_link($category[0]->cat_ID).'">'.$category[0]->cat_name.$separator.'</a>';
    			}
            }
            if (is_category()) {
                $category = get_the_category();
                echo ''.$category[0]->cat_name.'';
            }		
    		if (is_tag()) {
    			echo ''.__('Tag','tempera').''.$separator.single_tag_title('', false);
    		} 
            // Current page
            if (is_page() || is_single()) {
                echo ''.get_the_title().'';
            }
           echo '</div>';
        }
    	elseif (is_home() && $tempera_frontpage!="Enable" ) {
            // Front page
            echo '<div class="breadcrumbs">';
            echo '<a href="'.home_url().'"><i class="icon-homebread"></i></a> '.$separator;
            _e('Home Page','tempera');
            echo '</div>';
        }
     }	
    } // tempera_breadcrumbs()
    add_action('after_setup_theme','remove_fonction_parent2');
    function remove_fonction_parent2() {
       remove_action('cryout_before_content_hook','tempera_breadcrumbs');
       add_action ('cryout_before_content_hook','tempera_breadcrumbs1');
    }
    /*

    You have to change the information about your theme.

Viewing 25 results - 51 through 75 (of 191 total)
Skip to toolbar