Search Results for 'is_bbpress'
-
AuthorSearch Results
-
September 10, 2016 at 3:56 am #177754
In reply to: Enque bbpress scripts only on forum pages
Themezly
Participant2 months not even a hint and you know it is a bug. is_bbpress does not work as advised.
September 9, 2016 at 12:27 pm #177740In reply to: there is no bbPress sidebar
Robin W
Moderatoryou 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.
September 8, 2016 at 12:02 am #177705In reply to: Genesis remove a widget area
Robkk
ModeratorI 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{}.
September 3, 2016 at 8:41 pm #177607In reply to: Genesis remove a widget area
Robkk
ModeratorI 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
crayc
ParticipantI 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 W
Moderatorok, 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
crayc
Participantthanks. 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 W
Moderatorok, 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 W
Moderatorso 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 W
ModeratorI 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 Themescrayc
ParticipantHello, 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 #175756Robkk
ModeratorOr 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 ThemesThemezly
ParticipantI 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
tech55541
ParticipantHello,
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
awal16
ParticipantI 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 W
Moderatorjust 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 Oosterwijk
ParticipantHi 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 W
ModeratorThis 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 Tibbetts
ParticipantThanks, 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
32diego
ParticipantFor 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 InstallationThibaut
ParticipantHello 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
Robkk
ModeratorYou 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
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' ); } } ?>
-
AuthorSearch Results