Search Results for 'is_bbpress'
-
AuthorSearch Results
-
July 18, 2014 at 4:09 pm #149313
In reply to: My topics side bar is not appearing in my forum?
Robin W
ModeratorOk,
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 boxJuly 17, 2014 at 2:07 am #149229In reply to: Different Sidebar for the Forums
Robin W
Moderatorbbpress 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
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.
July 8, 2014 at 11:56 am #148860In reply to: Very simple question — changing font size
Robin W
Moderatorif (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.
July 8, 2014 at 11:10 am #148858In reply to: Very simple question — changing font size
ninjaunmatched
ParticipantOkay I found the code which is on this site actually.
But the code mentioned:
if (is_bbpress()) :
div class=”abc”
else :
div class=”xyz”
endif;Still would not make sense to everyone. So I’m thinking the first part is the main part. After the colon you would change the div class to whatever you want change which would be some of the classes mentioned in this thread to another class that you create which simply just changes the font size.
I’m thinking this way you would have to create your own classs for each thing you want to change in bbpress whether it was the reply text, the header text, or the content text. If I am off a bit or a lot just chime in. Hope it helps.
June 24, 2014 at 1:05 pm #148163In reply to: Not seeing forum sidebar
Robin W
ModeratorGetting bbpress to work with the many very clever (too clever!) themes is not always easy
Ok, we could spend a lot of time getting a forum specific sidebar for your theme, but maybe easiest to get your sidebar working to display in bbpress
so install widget logic
https://wordpress.org/plugins/widget-logic/
Then set up whatever sidebar is being displayed on the bbpress page for all the widgets that you want it to display, both for the homepage and bbpress
Then you’ll see each widget now has a widget logic condition.
For items you want to display only on bbpress add the logic
is_bbpress()
For items say only on a home page add
is_home()
for items you want on all pages apart from bbpress use
!is_bbpress()
Come back if anything is not clear
June 16, 2014 at 1:58 pm #147787In reply to: Full Width Forum Help
Robin W
Moderatorok, this is not my strong area, but try making this as your bbpress.php page
<?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. ?>
June 10, 2014 at 5:42 am #147572In reply to: change forum sidebar
Robin W
Moderatorthis is a widget logic problem, but try
!is_page(‘page_name’) || (is_single() && !is_bbpress())
if not, then try the support page, but is not well responded to
June 10, 2014 at 5:00 am #147570In reply to: change forum sidebar
Mareva
ParticipantHi!
Thank you for the !is_bbpress() code, that works perfectly with Widget Logic plugin.
My trouble is: I’d like to specify more that one condition, e.g :
!is_page(‘page_name’) || !is_bbpress()Unfortunatly, !is_bbpress code is not interpreted anymore when using this condition (the widget appears in the sidebar of all pages of the forum).
Any idea about what I should do to make it work?June 9, 2014 at 11:12 am #147550Topic: Remove sidebar
in forum Troubleshootingaborruso
ParticipantHi all,
I know that there are several post about it, but I’m not able to find a solution for my forum.
It’s password proteceted and I cannot send you any link.– I have WordPress 3.9.1 and bbpress 2.5.4
– I use Twenty Eleven (I know it’s a bad theme for bbpress)
– I have copied the content of /wp-content/plugins/bbpress/templates/default folder in my theme folder
– I have edited all the php files of my /wp-content/themes/mytheme/bbpress folder and commented “get_sidebar()” function
– I have created forum.php and bbpress.php file starting from page.php template and commented “get_sidebar()” functionBut I have always the sidebar (below bbpress).
If I use this code
function disable_all_widgets( $sidebars_widgets ) { if ( function_exists('is_bbpress') ) { if (is_bbpress()) { $sidebars_widgets = array(false); remove_all_actions('bp_register_widgets'); unregister_sidebar( 'bp_core_widgets' ); } } return $sidebars_widgets; } add_filter('sidebars_widgets', 'disable_all_widgets', 1, 1);
all the widgets disappear, but I have always meta links.
I know I should change theme. Do you have some tips for this one?
Thank you,
Andrea
June 1, 2014 at 12:29 pm #147241Robin W
Moderatorgetting it to display is easy !
bbpress deosn’t use ‘the content’ function in its loops, so we need to hook to the bbpress content function which is bbp_get_reply_content
So you just add a second filter after line 15, this then puts the ratings in the display
{ add_filter('the_content', 'spr_filter', 15); add_filter ('bbp_get_reply_content', 'spr_filter') ; }
Then the next bit of the plugins code looks at whether we have an individual post/page or are in a loop – a list of pages/posts.
If just one (is_singular) then it will display the rating, and let you add one.
If in a loop then it simply displays, and doesn’t let you alter, or that’s what I think it’s doingso to get it to understand that we’re in a list of replies (ie loop-single-reply) we test that we’re in bbpress
so we add a test for bbpress into the first function viz
foreach ($list as $list_) { if (is_bbpress() ) { if ($options['position']=='before') { $content=spr_rating().$content; } elseif ($options['position']=='after') { $content .= spr_rating(); } break; } if (is_singular($list_)&&$options['where_to_show'][$list_]&&$disable_rating!='1')
Ok so that does the display (at the moment for both topics and replies, but that’s easily fixed later)
What I can’t work out quite is why the amend doesn’t work. I think it is because the javascript/ajax is using spr_rate, but expects that to be part of $_post, but that’s may be failing as we are sort of in a bbpress loop at that stage, not in an individual post, so I dontl know what’s it looking for as post_id.
Anyway I’m rubbish at ajax/js etc. so am just poking code in the hope of finding a fix.
So that’s as far as I’ve got for now !!
May 29, 2014 at 2:25 pm #147155In reply to: Only the admin can attach
Robin W
Moderatoryou could try adding the following to your functions file
add_filter( 'd4p_is_bbpress', '__return_true' );
or seeing if your theme or other plugins are affecting
Plugins
Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.
Themes
If plugins don’t pinpoint the problem, switch to a default theme such as twentytwelve, and see if this fixes.
May 1, 2014 at 11:11 am #145720Topic: Check if on page/blog or forum
in forum TroubleshootingApril 23, 2014 at 1:43 pm #145398Topic: is_bbpress() defined on the BuddyPress profile page
in forum Troubleshootingnirgalo
ParticipantHi, I am using is_bbpress() in page.php to check whether I am in a bbPress context. It seems BuddyPress and bbPress are sharing the same profile page. Therefore, when the latter is being displayed, bbPress is being defined, and this triggers wrong behavior in my code. So, how can I check a bbPress or BuddyPress profile page is being displayed so I can fix my code? thx.
April 8, 2014 at 4:26 am #144758In reply to: Getting forum page name from plugin
SooperGenius
Participantis_bbpress() almost works. Thanks for the pointer there, by the way. I can’t see how I missed that function in all my searching. I failed my Google-fu obviously. My code now looks like this in the my-plugin.php file.
function forum_lock_check($allcaps, $cap) { if (function_exists("is_bbpress")) { $is_bbpress = is_bbpress(); } else { $is_bbpress = false; } return $allcaps; } add_filter("user_has_cap", "forum_lock_check", 10, 3);
Here’s the funny part. (Funny = weird not Funny = haha) If I’m navigating to the main forums page (http://localhost/wordpress/forums/), then everything proceeds swimmingly. If I then navigate to a forum within the page (http://localhost/wordpress/forums/forum.forum-a) or to a thread within the forum (http://localhost/wordpress/forums/topic/post-1) I then get several of the following errors.
Notice: Trying to get property of non-object in C:\xampp\htdocs\wordpress\wp-includes\query.php on line 3792 Notice: Undefined property: WP_Query::$post in C:\xampp\htdocs\wordpress\wp-includes\query.php on line 3306
Commenting out the “$is_ppbress = is_bbpress();” line removes the errors but I’ve got no idea why WordPress suddenly doesn’t like the code. Have you seen this before? What file is is_bbpress() in?
Thanks, Robin.
April 8, 2014 at 3:09 am #144753In reply to: Getting forum page name from plugin
Robin W
Moderatoris_bbpress()
should do it I think.
Otherwise bbpress has custom post types of forum, topic and reply.
You should also consider disabling or modifying the bbpress search function, as otherwise searches will go forum wide, giving a backdoor.
Good luck !
February 14, 2014 at 4:31 am #142479In reply to: Few issues with BBpress installation
Robin W
ModeratorThink it’s as simple as
is_bbpress()
so try
<div class="breadcrumbs"> if(function_exists('bcn_display') && is_bbpress()) { bcn_display(); }</div>
Haven’t checked the syntax, I’ll let you do that
February 11, 2014 at 11:54 am #142361In reply to: bbpress sidebar
Robin W
Moderatorpresume you are using the code is_bbpress() in your widget logic?
February 11, 2014 at 10:05 am #142345In reply to: widget context – are forum topics same as posts?
Robin W
Moderatorthe answer is probably yes – a forum post is a post
You might do better to install bbPress WP Tweaks Widget Logic plugin which gives you a forum specific sidebar
alternately (or additionally) use widget logic where you can use code like
is_bbpress()
or the negative!is_bbpress()
to control where widgets are shownJanuary 17, 2014 at 8:36 pm #141557cdonahue
ParticipantSolved!
Added this code to the bottom of my ‘page’ template, as that appears to be the default page for bbpress:
if (is_bbpress()) {
get_sidebar(forum);
} ?>et voila.
January 14, 2014 at 1:08 pm #141429In reply to: Where is registered the forum sidebar?
piccart
ParticipantHi guys! sorry but I forgot to pin the notifications for this post so I just realized about your replies..
it wasn’t very technical actually, but I think it depends a lot on the theme you have.
if just added a conditional into the class of my page template main content and of the sidebar wrap:
<?php if (is_bbpress() || is_page('forum')){ echo "forum_layout"; } ?>
it will have to be added something like this:
<div class="grid__item main float--left <?php if (is_bbpress() || is_page('forum')){ echo "forum_layout"; } ?>">
then is all about css, so it depends on yours. but you should be able to override the interested divs, appending your .forum_layout class in this way:
.grid__item.main.forum_layout { width:76%; } .grid__item.sidebar.forum_layout { width:24%; }
then at the same you can override the normal layout fonts, colours, etc.. if something is not considering your new style, try adding !important in this way:
width:24% !important;
hope that’ll help! 😉
January 9, 2014 at 2:54 am #141184In reply to: Where is registered the forum sidebar?
Stephen Edgar
KeymasterThere are numerous ways of doing this:
You can use a conditional to check
is_bbpress()
Make some copies of your templates for example and make a copy of
page.php
file and rename it tobbpress.php
and call a specific sidebar template egbbpress-sidebar.php
from yourbbpress.php
template.January 8, 2014 at 10:21 am #141124In reply to: Thousands of revisions
inspirationally
ParticipantAfter deactivating all bbPress related Plugins, it still occured. Now I removed the functions.php and it seems to have stopped and I’m re-adding it one snippet after the other, but I always have to wait half an hour between each snippet to see if it continues. No idea how to test it “immediately”.
It might be something about this part:
//Remove bbPress Head on non bbPress sitesadd_action( 'wp_head', 'conditional_bbpress_head', 9 );
function conditional_bbpress_head(){
global $post;
if( !is_bbpress() && !(is_home() && $_SERVER['SERVER_NAME'] == 'deppheads.com') && !(isset( $post->post_parent ) && $post->post_parent == "17123") )
remove_action( 'wp_head', 'bbp_head' );
}
add_action( 'wp_enqueue_scripts', 'conditional_bbpress_scripts', 9 );
function conditional_bbpress_scripts(){
global $post;
if( !is_bbpress() && !(is_home() && $_SERVER['SERVER_NAME'] == 'deppheads.com') && !(isset( $post->post_parent ) && $post->post_parent == "17123") )remove_action( 'wp_enqueue_scripts', 'bbp_enqueue_scripts' );
}
which I added because I have two domains running and just one little part under the domain deppheads is actually the forum, and I did not want all that bbPress code in all sites, especially not on my main site.
Is that possible??December 21, 2013 at 2:23 pm #140556In reply to: Widgets and Side Bar not showing in Forum
Robin W
Moderatorok, plan b
upload the “widget logic” plugin
This lets you set widgets to appear in certain conditions
Once uploaded, using your normal sidebar, you can set when a widget appears
You’ll see a new box appear when you add/edit each widget saying “widget logic”. if you want it to appear on a forum page type
is_bbpress()
If you want the widget to appear on other pages, but not obn the forum page type!is_bbpress()
so you login widget would have the logicis_bbpress()
and appear only on forum pagesIf you didn’t want search on the forum page, you’d put
!is_bbpress()
on that widget and it will not appearDecember 15, 2013 at 7:52 pm #140334In reply to: Sidebars in BBpress profile
Sloppy Buns
ParticipantI have worked part of this out and have implemented a is_bbpress format for forum pages so I can choose what sidebars to put on my forum pages however I am still not able to get sidebars to show up on profile or most popular topics.
What I require is the is_ codex for these pages so I can write a script to place sidebars on these pages, I have found that the User profile has these html body classes:
bbp-user-page single singular bbpress
is_bbpress() does not workand Most Popular Topics:
bbp-view bbpressThis should be is_bbpress() however is_bbpress() does not work.
Any help would be greatly appreciated.
December 12, 2013 at 4:39 pm #140187In reply to: "Link to existing content" reveals private pages
Lynqoid
ParticipantI’m not 100% on what is happening without seeing a site link, if you can find out where the coupons are being rendered then you could wrap them in
if(!is_bbpress()) { }
-
AuthorSearch Results
Short question: How do I check if I’m on a page (or blog) from within ‘loop-single-reply.php’?
WP 3.8.3
bbpress 2.5.3
URL: 24baby.nl
Long question: I use bbpress for all my comments on articles and blogs: ‘Use a bbPress forum topic for comments on this post.’
On my website this generates a first post along the lines of (my website is in Dutch): ‘This topic belongs to article <LINK>. Share your thoughts!’
This text is visible both under the actual article and on the forums. While it’s a good way to explain the purpose of the thread on the forums, it’s confusing as the first reply on the actual article page. Because of that I don’t want to show this first reply on all my blog / page ‘pages’, but do want to show them on the forums.
It’s fairly easy to remove the first reply within ‘loop-replies.php’, but I don’t know how to test whether I’m on the forums or not? Is_page doesn’t work, is_bbpress always returns true.