Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'is_bbpress'

Viewing 25 results - 76 through 100 (of 191 total)
  • Author
    Search Results
  • Luis Fatorbinario
    Participant

    I use to have a good custom function on my theme that add custom banners before articles, what I do is to write a function with the rotation ads inside.

    The final lines are like this:

    return $custom_adsense . $content;
    }
    add_filter(‘the_content’, ‘custom_banner’);

    What is the_content equivalent in bbPress?
    How can I add a custom banner over all topics?

    My theme is Twenty Fourteen and I have a nice space above these forum pages that fits ads perfectly.

    #162434
    Robkk
    Moderator

    @juggledad

    @robkk: Just to clarify something, the OR function_exists(‘is_bbpress’) was added (with some other code, to get around a bug that bbpress doesn’t seem to want to acknowledge or fix. see https://bbpress.trac.wordpress.org/ticket/2723

    Thanks for pointing that out, i did not know about that bug.

    Okay with this bug in bbPress you cannot use the WP conditional is_single() to affect all of the bbPress pages, since for some reason there is a bug for single user pages.Thanks for creating the trac ticket, I tested out and see that yes it does not work on user pages. Over the next few days/week i will check it out and see I can come up with a fix.

    But this bug is easily avoidable by creating a bbpress.php for your theme and just using the_content() instead of bfa_post_bodycopy() and removing OR function_exists('is_bbpress') from the bfa_post_bodycopy() function. The bbpress.php file also helps remove other post meta that might not be useful for bbPress forums instead of using CSS to hide them.

    The OR function_exists('is_bbpress') you can keep in bfa_get_options.php though as i do not see any problems with that.

    If there is something you can find on your end to fix the issue with your theme and bbPress then please drop an answer on this topic, because i haven’t looked and learned your theme 100% yet. Removing the function exists and creating a bbpress.php is the quickest solution to the problem that I could find.


    @kitfreeman

    This excerpt issue that you are seeing affects all of these areas

    category pages
    tag pages
    author pages
    archive pages
    search result pages
    and the home page

    which is where all the excerpt theme settings modify.

    #162407
    juggledad
    Participant

    @robkk: Just to clarify something, the OR function_exists('is_bbpress') was added (with some other code, to get around a bug that bbpress doesn’t seem to want to acknowledge or fix. see https://bbpress.trac.wordpress.org/ticket/2723

    #162375
    Robkk
    Moderator

    ok thanks for reminding me …again.

    i have been losing track on these topics lately.

    What i found is that this bug is because of your theme and not really bbPress. So i recommend contacting your theme developers about this especially since they want to support bbPress.

    in the bfa_post_parts.php file in your functions folder, under the bfa_post_bodycopy function you will see

    OR function_exists('is_bbpress')

    This is what is causing your issue.

    the way i figured out to fix it is to remove this and create my own bbpress.php off of the index.php file from your theme.

    this is all the code i used to create the file. So you can copy and paste this into your theme into a bbpress.php file and all should work …hopefully.

    I also left the widget areas there if you want them still there user theme/replace them or just remove them.

    <?php 
    list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();
    get_header(); 
    extract($bfa_ata); 
    global $bfa_ata_postcount;
    ?>
    
    <?php /* If there are any posts: */
    if (have_posts()) : /* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>
    
        <?php  if ($bfa_ata['widget_center_top'] <> '') { 
              echo bfa_parse_widget_areas($bfa_ata['widget_center_top']); 
    	} ?>
    
    	<?php while (have_posts()) : the_post();?>
    	
    		<?php /* Post Container starts here */
    		if ( function_exists('post_class') ) { ?>
    		<div <?php if ( is_page() ) { post_class('post'); } else { post_class(); } ?> id="post-<?php the_ID(); ?>">
    		<?php } else { ?>
    		<div class="<?php echo ( is_page() ? 'page ' : '' ) . 'post" id="post-'; the_ID(); ?>">
    		<?php } ?>
    		<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
    		<div class="post-bodycopy clearfix"><?php the_content(); ?></div>
    		</div><!-- / Post -->	
    						
    	<?php endwhile; ?>
    
        <?php if ($bfa_ata['widget_center_bottom'] <> '') { 
              echo bfa_parse_widget_areas($bfa_ata['widget_center_bottom']); 
        } ?>
    
    <?php endif; /* END of: If there are no posts */ ?>
    
    <?php get_footer(); ?>
    Robkk
    Moderator

    @mentions is not part of bbPress yet.

    but for now you can use the @mentions feature from BuddyPress and use on forums with this code.

    copy this into your child themes functions.php or use a functionality plugin.

    function custom_bbpress_maybe_load_mentions_scripts( $retval = false ) {
    	if ( function_exists( 'bbpress' ) && is_bbpress() ) {
    		$retval = true;
    	}
     
    	return $retval;
    }
    add_filter( 'bp_activity_maybe_load_mentions_scripts', 'custom_bbpress_maybe_load_mentions_scripts' );

    and i think you would get an email notification from BuddyPress anytime you get @mentioned

    for multiple users you can just separate it with a space.

    #160218

    In reply to: @mentions feature

    Robkk
    Moderator

    bbPress i think will have @mentions in a future release, but for now you can use BuddPress’s own scripts for bbPress using this function.

    add it to your child theme functions.php or a functionality plugin

    function custom_bbpress_maybe_load_mentions_scripts( $retval = false ) {
    	if ( function_exists( 'bbpress' ) && is_bbpress() ) {
    		$retval = true;
    	}
     
    	return $retval;
    }
    add_filter( 'bp_activity_maybe_load_mentions_scripts', 'custom_bbpress_maybe_load_mentions_scripts' );
    #159272

    In reply to: widget side

    Robin W
    Moderator

    ok, if you can’t get the right sidebars to show, just have one sidebar and use widget logic to decide what widgets show in which pages

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

    then for each widget there is a widget logic box

    put

    is_bbpress() if you want that wiodget to appear in forums
    !is_bbpress if you want it to appear in pages other than forums
    and leave blank for both

    #159074
    Robin W
    Moderator

    ok, try

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

    use

    is_bbpress()where you want a widget displayed on bbpress pages and
    !is_bbpress() where you don’t

    #158776
    Robin W
    Moderator

    ok install widget logic

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

    this adds a box to each widget in a sidebar

    so work out which sidebar is showing in your bbpress pages and for each widget in that sidebar into that box put

    is_bbpress() if you want it to appear in forum pages
    !is_bbpres() is you don’t want it to appear in forum pages (but do want it on other pages where that sidebar appears
    and leave blank if you want tit to appear on both forum and other pages

    #158636

    In reply to: change forum sidebar

    Robin W
    Moderator

    the try widget logic

    Download “widget logic”

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

    This plugin lets you specify conditions for when widget items are displayed.

    You would then put all the widgets for both the blog page and the forum page in one sidebar

    Against each of these you then specify whether you want it to appear on the forum page, on any page with a sidebar that is not the forum (eg your blog), or on both forum and other sidebar pages.

    you do this by putting the following code in the widget logic box that you will see appears against each widget

    For a forum sidebar you put : is_bbpress() ie is this page a forum page
    For any other sidebar you put : !is_bbpress() ie is this page NOT a forum page
    For any item to appear on both, simply leave the logic blank.

    Give that a try and come back and let us know how it works

    #158562
    Robin W
    Moderator

    ok, it’s your theme that’s causing the issue, some theme authors are too clever with their coding, and bbpress uses a category of archive, hence why it is displaying this sidebar. Also I suspect the theme won’t be allowing dynamic sidebars, hence why tweaks isn’t working.

    So onto plan b !

    install a plugin called ‘widget logic’

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

    Then against each widget in your archive/post/search sidebar, you’ll see an extra field called widget logic

    If you want that widget only in bbpress forums put

    is_bbpress()
    

    in to that line

    if you don’t want that widget in bbpress, but do want it in other pages that use the archive/post/search sidebar the put

    !is_bbpress()
    

    in the widget logic area

    If you want in both, then leave widget logic blank.

    #158113

    In reply to: Error on deactivate

    crack00r
    Participant

    Line 65 is:
    if( is_page() || is_bbpress() ) {

    function travelify_theloop() {
    	if( is_page() || is_bbpress() ) {
    		if( is_page_template( 'templates/template-blog-large-image.php' ) ) {
    			travelify_theloop_for_template_blog_image_large();
    		}
    		elseif( is_page_template( 'templates/template-blog-medium-image.php' ) ) {
    			travelify_theloop_for_template_blog_image_medium();
    		}
    		elseif( is_page_template( 'templates/template-blog-full-content.php' ) ) {
    			travelify_theloop_for_template_blog_full_content();
    		}
    		else {
    			travelify_theloop_for_page();
    		}
    	}
    #158112
    crack00r
    Participant

    Hi, i have a wired problem.
    When i have bbpress activate, my page works fine.

    but when i deactivate the bbpress plugin, my mainpage stop working,
    and i get a php error in logs

    [10-Feb-2015 10:47:43 UTC] PHP Fatal error:  Call to undefined function is_bbpress() in /var/www/clients/client3/web3/web/wp-content/themes/travelify/library/structure/content-extensions.php on line 65
    
    #157721
    Robin W
    Moderator

    ok, the following code removes the edit for bbpress, but leaves it for normal wordpress pages

    function wpse_remove_edit_post_link( $link ) {
    	if (is_bbpress()) return '' ;
    	else return $link ;
    	}
    add_filter('edit_post_link', 'wpse_remove_edit_post_link');
    

    The users will still be able to edit their topics and replies via the in-box edit buttons

    #157410
    nicholmikey
    Participant

    After installing BBPress nothing was working, I could see a list of forums if I went to /forums/ but nothing appeared to create a new forum or post, and no form appeared to enter a reply. I rebuilt the pages using the shortcodes and this worked great, but if I click “Edit” on a reply I get a page with no content.

    Here is the code I am using in my main template to make the BBPress items show up:

    				<?php if (is_bbpress()) : ?>
    				<section id="content" class="grid-block"><h3 class="page-subtitle"><?php echo $this['config']->get('Subtitle'); ?></h3>
    				<?php 
    				if(!is_user_logged_in())
    				{
    				    echo do_shortcode("[bbp-login]"); 
    				} else {
    				echo 'bbpress page';
    				$forum_id = get_the_ID();
    
    				if( get_post_type( $forum_id ) == 'page')
    				{
    					echo do_shortcode("[bbp-forum-index]");
    				}
    				echo do_shortcode("[bbp-single-forum id=" . $forum_id . "]"); 
    				echo do_shortcode("[bbp-single-topic id=" . $forum_id . "]"); 
    		
    				}
    				?>

    I can’t find a shortcode for the reply edit form. How can I made the reply edit form appear on a page?

    Also none of the forms worked until I added this to the functions.php:

    add_filter( 'bbp_verify_nonce_request_url', 'my_bbp_verify_nonce_request_url', 999, 1 );
    function my_bbp_verify_nonce_request_url( $requested_url )
    {
        return 'http://localhost:8088/mySite/' . $_SERVER['REQUEST_URI'];
    }

    I am using a woo-theme with their warp system, I think it does not work well with bbpress.

    Please, how can I made the edit form appear? There appears to be no shortcode for that.

    #156740
    Robin W
    Moderator

    Try the following

    //adds login/logout to menu
    //filter to add login/logout to menu
    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()) {
        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 = '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;
    }
    #155581
    jimbofoxman
    Participant

    Disregard, I atleast have it figured out for now. I copied the theme-styles.php file to the child theme and then searched for;

    	if ( is_page_template('page-landing.php') || is_page_template('page-alt-home.php') ) {
    		$layout = "Full-Width";
    		global $solostream_options;
    		$solostream_options['solostream_layout'] = $layout;

    and added the following right below it…

    	if ( is_bbpress() ) {
              $layout = "Full-Width";
              global $solostream_options;
              $solostream_options['solostream_layout'] = $layout;
         }
    #155312
    Toby
    Participant

    Still not completely sure why this is happening, but I think it’s because of the way the forum is being displayed using the BuddyPress group tabs/screen hooks. Digging into the is_bbpress() function, none of the WP_Query information is being set so it doesn’t pass any of the is_ functions.

    You can filter is_bbpress in bbpress > includes > extend > buddypress > groups in the setup_filters() function and get it working, but I can’t see a way of doing this without modifying the plugin code.

    #153309
    Themeover
    Participant

    Hi guys,

    I was battling with this issue too. I didn’t want to abandon the Yoast SEO plugin so this is the function I added to functions.php in my WordPress theme to fix the issue:

    // fix yoast seo plugin issue with user title
    function fix_not_found_title($title){
    if (is_bbpress()){
    if ($title == ‘Page Not Found – SiteNameHere’){
    return ‘Forum User: ‘.bbp_get_displayed_user_field( ‘display_name’ );
    } else {
    return $title;
    }
    } else {
    return $title;
    }
    }
    add_action( ‘wpseo_title’, ‘fix_not_found_title’ );

    It’s a bit of a hack but it works for now. I hope that helps!

    Cheers,

    Sebastian

    #151978
    Toby
    Participant

    I’m using the following in my theme’s functions.php, although for some reason is_bbpress() isn’t working on Buddypress Group Forums for me.

        if( ! function_exists( 'my_dequeue_bbp_scripts' ) )
        {
            function my_dequeue_bbp_scripts()
            {
                if( function_exists( 'is_bbpress' ) )
                {
                    if( ! is_bbpress() )
                    {
                        wp_dequeue_style('bbp-default');
                        wp_dequeue_style('bbp-default-rtl');
                    }
                }
            }
        }
        if( ! is_admin() ) add_action( 'wp_enqueue_scripts', 'my_dequeue_bbp_scripts' );
    Toby
    Participant

    Using WordPress 3.9.2, bbPress 2.5.4 and BuddyPress 2.0.2. Site is password protected I’m afraid. It is using a custom theme, based on Responsive.

    is_bbpress() is returning false on any bbpress pages that fall under a BuddyPress group. If this seems to be custom theme related are there any tips for debugging?

    #149866

    In reply to: Full Width Forum Help

    watstyl08
    Participant

    I just used this code, to no avail. It causes an error on the site – check it out.

    <?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. ?>
    #149313
    Robin W
    Moderator

    Ok,

    Can you confirm that that you actually followed my instructions? Which weren’t to re-install the widget. If you’ve simply done that then you would not have changed any settings (they remain in the database on deletion and are just re-enlivened when the widget is re-installed) and you would still have the problem. If you follow the instructions, this changes settings and in many cases gets it working.

    But assuming you haven’t tried to guess what I was trying to get you to do, and have followed the instructions and these didn’t work, then we’ll try approach 2.

    This involves installing another plugin and using that to set conditions on the sidebar.

    so go to dashboard>plugins>install new and look for ‘widget logic’ by Alan Trewartha and install that.

    This lets you set conditions on when a widget appears in the sidebar.

    so now in your main sidebar if you look at any widgert you’ll see a new box at the bottom which says widget_logic

    for any widgets you want in all your pages including bbpress – just leave this blank
    for widgets that you just want in bbpress pages add the logic
    is_bbpress() in the widget logic box
    for widgets that you don’t want in bbpress pages add the logic
    !is_bbpress() in the widget logic box

    #149229
    Robin W
    Moderator

    bbpress will use the default page template for the main index rather than the specific page template set in the page – so your setting in the forum page won’t apply.

    There are several ways around this, but as your plugin is a paid one, I can’t see the code to recommend the best solution.

    So first off I’d post a query onto their support site

    Outstanding Support

    they probably have come across bbpress before and will know the answer. You could tell them that bbpress uses ‘is_bbpress()’ to see if it is a bbpress page, that might help them.

    #148860
    Robin W
    Moderator
    if (is_bbpress()) :
     div class=”abc”
    else :
     div class=”xyz”
    endif;

    translates to

    if you are on a bbpress screen/page/display [as opposed to a wordpress blog post or page, a home page or anything that isn’t bbpress]

    the use div class abc

    if you are on any other type of page use class xyz.

    Many themes use if statements checking against ‘conditional tags’ to style areas for instance the conditional tag is_home() checks whether this is the home or index page.

Viewing 25 results - 76 through 100 (of 191 total)
Skip to toolbar