Search Results for 'is_bbpress'
-
AuthorSearch Results
-
September 3, 2016 at 8:41 pm #177607
In reply to: Genesis remove a widget area
RobkkModeratorI 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.
September 3, 2016 at 2:39 pm #177603In reply to: Genesis remove a widget area
craycParticipantI 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
September 3, 2016 at 1:36 pm #177601In reply to: Genesis remove a widget area
Robin WModeratorok, 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?
September 3, 2016 at 1:04 pm #177600In reply to: Genesis remove a widget area
craycParticipantthanks. 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.
September 3, 2016 at 2:58 am #177594In reply to: Genesis remove a widget area
Robin WModeratorok, 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.
September 2, 2016 at 4:36 pm #177585In reply to: Genesis remove a widget area
Robin WModeratorso did you try it as that, or as
if (is_bbpress( ‘forums’ ) ) {is_bbpress doesn’t take arguments
September 1, 2016 at 6:37 pm #177568In reply to: Genesis remove a widget area
Robin WModeratorI tried the If conditional tag on there but it does not seem to work.
do you mean
if (is_bbpress() )…
?
September 1, 2016 at 5:46 pm #177566Topic: Genesis remove a widget area
in forum ThemescraycParticipantHello, 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!
June 14, 2016 at 3:09 pm #175756RobkkModeratorOr 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.
June 14, 2016 at 2:37 pm #175755Topic: Enque bbpress scripts only on forum pages
in forum ThemesThemezlyParticipantI 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!
March 26, 2016 at 9:50 pm #173470In reply to: how to add specific left/right sidebar
tech55541ParticipantHello,
Couldn’t you still use functions.php with this code to restrict it to BBPress.if ( is_bbPress() ):
Makes since to me.
Thanks.
March 8, 2016 at 10:34 am #172635In reply to: same sidebar for each forum topic/forum
awal16ParticipantI 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.
March 2, 2016 at 3:51 pm #172424In reply to: bbPress login redirect WITH woocommerce
Robin WModeratorjust 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 = xx
type statement on line 71February 17, 2016 at 4:47 am #171835In reply to: Change Breadcrumb url link
Adri OosterwijkParticipantHi 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
February 2, 2016 at 5:10 am #171224Robin WModeratorThis old link talks about using templates
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.
February 1, 2016 at 10:05 am #171157In reply to: is_singular() Always False, Everywhere
Andrew TibbettsParticipantThanks, Stephen.
Ok, so, Query Monitor is telling me that topic pages are returning true on a bunch ofis_
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 ofbbpress/includes/common/template.php
insidebbp_is_single_topic()
, I get a white page that says “no”.November 19, 2015 at 6:28 am #169177In reply to: Theme update broken forum
32diegoParticipantFor 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;
}October 9, 2015 at 10:41 am #167643Topic: If is the frontpage of the forum
in forum InstallationTiPi64ParticipantHello 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.
September 29, 2015 at 4:28 pm #167202In reply to: Login, Register, Lost Password links
RobkkModeratorYou 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.
September 29, 2015 at 3:15 pm #167198In reply to: Divi theme and reply threading issue
RobkkModeratorI 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
mica123ParticipantWhen 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
klinkParticipantThank 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
mica123ParticipantHello
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
RobkkModeratorIt 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 LingParticipantIf 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.
-
AuthorSearch Results