Search Results for 'is_bbpress'
-
AuthorSearch Results
-
September 29, 2011 at 11:55 am #40169
common8308
ParticipantI was fixing a certain existing WP plugin to my taste to make it work in bbpress, and experienced comments_open() function is not stably working in bbpress.
In most cases it returned true in open topics/replies. but in less than 5% cases it returned false although the topic was open and making replies were available..
I just replaced comments_open() function to (is_user_logged_in() && is_bbpress()) and it worked fine. (Thank you for this function!)
I don’t think it’s not much important in using bbpress, but just curious to know how comments_open() function works in bbpress if it’s not too complicated.
September 24, 2011 at 6:08 pm #109225In reply to: is_page() equivalent for bbPress 2.0
Anointed
ParticipantI would try is_bbpress() from the bbp-common-template.php functions file.
September 21, 2011 at 3:58 pm #109091In reply to: BBPress Plugin for WordPress Conditional Tags
Clicknathan
ParticipantYay, there is! And it’s actually so obvious I should be ashamed for posting this question.
is_bbpress
More info in bbp-includes/bbp-common-template.php
September 4, 2011 at 8:43 am #108611In reply to: Loading the bbpress Stylesheet on bbpress only
al3xander
MemberHey John,
sorry to re-open this thread.
i just found something interesting, the »tags« page (ie: https://bbpress.org/forums/tags/stylesheet) is the only one which doesn’t recognize the is_bbpress() check.
September 3, 2011 at 9:21 am #108609In reply to: Loading the bbpress Stylesheet on bbpress only
John James Jacoby
KeymasterGood question. The main reason it loads all the time is shortcodes. bbPress doesn’t have any way to know that the_content contains a shortcode when the head of the page is being processed, so including it all the time is the safest bet for most people.
If you want to dial in your installation, you can wrap the CSS enqueue in a is_bbpress() check. is_bbpress() returns true when WordPress is loading up a bbPress specific page.
August 25, 2011 at 10:49 pm #107984In reply to: Skeleton – A Responsive WP/bbPress Theme
simplethemes.com
ParticipantYou should be able to add any widget to the ‘Forum Sidebar’ location.
If bbPress is installed, this widget location gets registered:
http://screencast.com/t/axXP7yykY
If it isn’t showing up, make sure it isn’t commented out in the forum templates you want it to show in. I only enabled it in the templates I felt were necessary (like the member pages).
On some of my forum pages I wanted a wide page, but you can certainly change it.
For example, to change the forum home page template, open archive-forum.php in the theme editor and just uncomment this line:
// get_sidebar('bbpress');
Then, in functions.php find this line:
// force wide on bbPress pages
if (is_bbpress()) {
$columns = 'sixteen';
}and change ‘sixteen’ to ‘eleven’ to accommodate the sidebar.
July 20, 2011 at 7:58 pm #107295In reply to: is_bbpress() doesn't account tag pages
Ashish Kumar (Ashfame)
ParticipantJuly 20, 2011 at 7:44 pm #107294In reply to: is_bbpress() doesn't account tag pages
John James Jacoby
KeymasterAgreed. Add a ticket on trac?
July 19, 2011 at 6:02 pm #39134Topic: is_bbpress() doesn't account tag pages
in forum TroubleshootingAshish Kumar (Ashfame)
Participantis_bbpress()
function currently doesn’t account for tag pages –http://dev.example.net/forums/topic-tag/testing/
Is it by design? I think it should account tag pages as they basically are bbPress pages.
July 6, 2011 at 5:32 pm #107099In reply to: Removing columns on Forum Pages
pimarts
ParticipantI run a combination of bbPress & Buddypress and this worked for me, I did put the following code in functions.php:
function disable_all_widgets( $sidebars_widgets ) {
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);
This removed all widgets aside from the user login, but that’s quite handy to be present at the forum pages. I put that on top of the forums with CSS.
December 19, 2008 at 10:33 am #70443In reply to: Can wordpress searcher search bbpress?
ganzua
MemberThanks for the code John
Half the results but it actually could solve the 404 problem.
However, adding a get_settings(‘home’) to the search form makes this search;
/wordpress/wordpress/bbpress/?s=
I had in mind that perhaps anybody developed a wordpress plugin that could search both, wp and bb and then display the results, first all the wp entries and next all the bb entries.
Or maybe a conditional in the wp template where I placed wp searcher; first the wp searcher with anything similar to John’s get_settings(‘home’) and then a conditional; if this is bbpress then use bbpress searcher and append the results. I already have a function to create bb conditionals in wp;
function is_bbpress() {
global $bb;
return $bb ? true : false;
}There is another search plugin for bbPress that appends a WordPress search to the bbPress search.
I wanted all the contrary
a wp plugin that appends bb results at the end of the search.
BTW, after finding the searcher issue I realized that 404 templates need integration too.
September 6, 2007 at 8:11 pm #60532fel64
MemberNo problem.
Option #3 was a throwaway possibility, not really meant for actual use as it’s rather silly.
whatever && !is_bbpress()
means, literally, thatwhatever
has to be true AND is_bbpress() is not true. The!
operator inverts the boolean meaning, so true becomes false and vice versa. If is_bbpress() is true,!
makes it read as false. If false, it makes it read as true.By the way, the backtick ` that indicates code is on the top left button on most English and European characters.
September 6, 2007 at 7:19 pm #60530ganzua
Memberoops! sorry, I didn’t define what happens whe is_bbpress(), I just exclude it.
now it is working;
‘
<?php if (
is_page()
)
{ ?>
<!– one ad block –>
<?php } elseif (
is_single()
&& !is_bbpress()
)
{ ?>
<!– two ad blocks –>
<?php } elseif (is_bbpress()
)
{ ?>
<!– half ad block –>
<?php } else
{ ?>
<!– no ads –>
<?php } ?>
‘
September 6, 2007 at 7:12 pm #60529ganzua
MemberWell, more or less this is working but now bbpress goes to the last “else” statement and I don’t know why;
‘
<?php if ( is_page() )
{ ?>
<!– one ad block –>
<?php } elseif ( is_single() && !is_bbpress() )
{ ?>
<!– two ad blocks –>
<?php } else
{ ?>
<!– no ads –>
<?php } ?>
‘
I haven’t try your third option yet because I didn’t understand quite enough.
September 6, 2007 at 6:12 pm #60528ganzua
MemberThanks again fel64,
I tried the second one because it seemed the easiest to me
and I think it is working ok.
This -> ‘ && !is_bbpress() ‘ means “exclude bbpress”, doesn’t it?
The first one, ” elseif “, is quite interesting -> in my wp custom theme, I turned index.php into a cms which displays what’s new in the whole web, and I created a static page called “blog” to display the “blog” itself.
Well, with this configuration, whenever you make a is_home statement , the function points to the static page I created and called “blog” and I can’t find the way to make the function to point to my custom index.php main page. Perhaps because the static page I called “blog” has the loop?
September 6, 2007 at 4:51 pm #60527fel64
MemberActually the function works just fine, you’re just expecting it to work differently. Try using different flow control or rewriting your logic.
if( blah_is_true() ) {
} elseif( foo_is_true() ) {
} elseif( third_thing_is_true() ) {
} else {
// default
}The elseifs mean that if a previous if statement was true, none of the successive ones will be tried. That way, if it is bb, it won’t even check if it’s single or a page.
Alternatively,
if( ( is_single() || is_page() ) && !is_bbpress() ) {
}will work just fine.
If you’ve integrated bb into wp that way, of course some of the WP template tags will work that way. If you wanted everything else to return false when you loaded bb, you’d have to do this:
function adjust_flags_to_bb() {
global $wp_query;
$wp_query->init_query_flags();
}
add_action('bb_init', 'adjust_flags_to_bb', 999);
//not sure if that's the right action, but mehbut that’s really quite unnecessary.
September 6, 2007 at 4:12 pm #60526ganzua
Member“What’s the actual problem? How are you using it, what do you expect it to do, what exactly is it doing?”
->
In my wp-bb integration, bbpress is integrated in wordpress and the forum uses the wordpress sidebar. I want to insert advertising blocks in the free space that I have in the bottom of the sidebar.
I’m trying to use wp conditional tags to display different ad blocks because in some pages I have space enough for one block, and in other pages I have space for two or three blocks.
In wp single pages I can display at least two 120×600 blocks so I’m using is_single() but I realized that these blocks are appearing in the bbpress forum too! and I just have no space enough for them so I want to change them for a 125×125 block when the forum is displayed or perhaps I could remove all ads when bbpress displayed.
So “How are you using it” -> after copy/pasting your function in my theme functions file, I inserted this code in my sidebar;
‘
<?php if (is_bbpress()
|| is_archive()
) { ?>
<!– 125×125 block –>
…
…
<?php } ?>
<?php if (is_single()
|| is_page()
) { ?>
<!– 160×600 block –>
…
…
<?php } ?>
‘
“what do you expect it to do” -> showing different ads blocks in the sidebar when bbpress displayed
“what exactly is it doing” -> is showing the blocks I set for is_single ()
September 5, 2007 at 7:25 pm #60523fel64
MemberMight have asked what you wanted straight away.
So open your theme’s functions.php and add this:
function is_bbpress() {
global $bb;
return $bb ? true : false;
}Off the top of my head, but should work anyway. Try it.
September 5, 2007 at 6:59 pm #60522ganzua
MemberHey fel64!
Thanks for the answer. Do you know if is it possible to copy these functions in your wordpress theme functions file?
In fact I only need to define one conditional tag; is_bbpress(), so I can display different advertising blocks in the wordpress sidebar when loading bbpress.
-
AuthorSearch Results