Search Results for 'is_bbpress'
-
AuthorSearch Results
-
September 29, 2015 at 3:15 pm #167198
In reply to: Divi theme and reply threading issue
Robkk
ModeratorI 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.
Contactadd_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' ); } }
September 29, 2015 at 2:50 pm #167197In reply to: Login, Register, Lost Password links
mica123
ParticipantWhen 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; }
September 29, 2015 at 2:46 pm #167195In reply to: Divi theme and reply threading issue
klink
ParticipantThank 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' ); } } ?>
September 28, 2015 at 7:54 am #167153In reply to: Login, Register, Lost Password links
mica123
ParticipantHello
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.September 26, 2015 at 2:27 pm #167086In reply to: Divi theme and reply threading issue
Robkk
ModeratorIt 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' ); } }
August 28, 2015 at 8:08 am #165975Mei Ling
ParticipantIf your theme gets a breadcrumb, then disable Yoast’s one. You may have two breadcrumb:
First ==> WordPress
Second==> BBPressYou 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.
June 12, 2015 at 10:55 pm #163132Luis Fatorbinario
ParticipantI 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.
May 25, 2015 at 3:26 am #162434In reply to: bbPress causes Category pages to show full posts
Robkk
Moderator@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 ofbfa_post_bodycopy()
and removingOR function_exists('is_bbpress')
from thebfa_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.
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 pagewhich is where all the excerpt theme settings modify.
May 23, 2015 at 5:16 pm #162407In reply to: bbPress causes Category pages to show full posts
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/2723May 23, 2015 at 9:37 am #162375In reply to: bbPress causes Category pages to show full posts
Robkk
Moderatorok 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 thebfa_post_bodycopy
function you will seeOR 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(); ?>
March 30, 2015 at 12:39 pm #160394Robkk
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.
March 26, 2015 at 6:08 pm #160218In reply to: @mentions feature
Robkk
ModeratorbbPress 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' );
March 5, 2015 at 5:33 pm #159272In reply to: widget side
Robin W
Moderatorok, 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 bothFebruary 28, 2015 at 6:16 pm #159074In reply to: Sidebar not displaying with bbPress WP Tweaks
Robin W
Moderatorok, 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’tFebruary 23, 2015 at 3:58 am #158776In reply to: How to style the sidebar
Robin W
Moderatorok 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 pagesFebruary 19, 2015 at 8:50 am #158636In reply to: change forum sidebar
Robin W
Moderatorthe 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
February 17, 2015 at 6:25 pm #158562In reply to: Significant trouble with a stubborn sidebar
Robin W
Moderatorok, 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.
February 10, 2015 at 7:10 am #158113In reply to: Error on deactivate
crack00r
ParticipantLine 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(); } }
February 10, 2015 at 7:05 am #158112Topic: Error on deactivate
in forum Troubleshootingcrack00r
ParticipantHi, 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
February 4, 2015 at 4:55 am #157721In reply to: Participants aren't able to edit their own topics
Robin W
Moderatorok, 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
January 27, 2015 at 5:57 pm #157410Topic: Edit reply – blank page
in forum Installationnicholmikey
ParticipantAfter 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.
January 10, 2015 at 2:34 pm #156740In reply to: Edit the bbPress login widget
Robin W
ModeratorTry 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; }
December 14, 2014 at 6:18 pm #155581jimbofoxman
ParticipantDisregard, 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; }
December 8, 2014 at 10:15 am #155312Toby
ParticipantStill 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.
October 14, 2014 at 7:46 am #153309In reply to: User Pages and Page Title "Not Found"
Themeover
ParticipantHi 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
-
AuthorSearch Results