Search Results for 'code'
-
AuthorSearch Results
-
October 27, 2020 at 1:31 pm #215485
In reply to: bbp-search on a single forum
Robin W
Moderatorjust tried that code on my test site and it works fine.
where are you putting it ?
October 27, 2020 at 8:53 am #215482In reply to: bbp-search on a single forum
Robin W
Moderatorok, try this
add_filter( 'bbp_before_has_search_results_parse_args' , 'my_bbp_filter_search_results' ); function my_bbp_filter_search_results( $args ){ $forum_id = 1715; if( $forum_id && is_numeric( $forum_id ) ){ $args['post_parent'] = $forum_id ; } error_log('Dedicated forum = ' . $forum_id); return $args; }October 27, 2020 at 7:05 am #215479In reply to: bbp-search on a single forum
talbotp
ParticipantHey Robin, Thanks for the reply, really appreciate it. I added this to my themes functions.php (from the article above), but hardcoded in a forum_id, just to test it out, and it doesn’t seem to work.
function my_bbp_filter_search_results( $r ){ $forum_id = 1715; if( $forum_id && is_numeric( $forum_id ) ){ $r['meta_query'] = array( array( 'key' => '_bbp_forum_id', 'value' => $forum_id, // 1715 x , 11 , 1717 , 'compare' => '=', ) ); } error_log('Dedicated forum = ' . $forum_id); return $r; } add_filter( 'bbp_after_has_search_results_parse_args' , 'my_bbp_filter_search_results' );the error log is coming through when the page is loaded, but i’m still getting discussions from other forums in the search results.
October 27, 2020 at 5:12 am #215472In reply to: bbp-search on a single forum
Robin W
Moderatorfrom a very quick look, that code looks like it should work, and not seen anything else that does this, so try it, and if it doesn’t work, come back
October 27, 2020 at 5:09 am #215471Robin W
Moderatoryour theme or elementor is doing this
it has a css entry
.has-sidebar:not(.error404) #primary { float: left; width: 58%; }you could change this to 100% in your custom css ie put this in your custom css
.has-sidebar:not(.error404) #primary { width: 100% !important; }but it might affect other parts of your site, so try it and see
October 27, 2020 at 5:04 am #215470Robin W
ModeratorOctober 27, 2020 at 5:04 am #215469In reply to: How to insert short codes under topic pages?
Robin W
Moderatorsorry, this one slipped by
add this code, changing ‘shortcode here’ to the actual shortcode you wish to execeute
add_action( 'bbp_theme_before_reply_form' , 'rew_add_shortcode'); function rew_add_shortcode () { echo do_shortcode( '[shortcode here]' ); }Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
October 27, 2020 at 4:26 am #215468Topic: How can I insert short codes under/above topic pages?
in forum Troubleshootingtruth4vahid
ParticipantHow can I insert short codes under/above each topic page or whole topic and reply page?
October 26, 2020 at 6:37 am #215457In reply to: Customization
wenlu
ParticipantCan I fix the problem by changing its codes in the specific files ?
If yes, due to I’m a new to WordPress, I don’t even know where should I edit the code.October 26, 2020 at 4:32 am #215448In reply to: Customization
Robin W
Moderatorthis still works as far as I know
so you would use
!is_bbpress()against the my posts – so that will only show on non bbpress pages
October 26, 2020 at 2:51 am #215442In reply to: WooCommerce Hiding Admin Bar for bbPress Moderators
samtime
ParticipantHi Robin, thank you for the code.
I replaced my existing code with what you pasted here, unfortunately it didn’t fix the issue.
Tried replacing the “WooCommerce” part with “woocommerce”, but still no luck.Thanks for the reply. If you have any other ideas, it would be greatly appreciated.
I’ll keep searching.Thanks again,
SamHere’s the website btw:
https://funkytime.tv/forums/October 25, 2020 at 5:55 pm #215437cgauthey
ParticipantHello,
I have a problem here my forum is small when I look at it on the index I would like to take the full width of the page.How to do what code I will be able to enter in the CSS
October 25, 2020 at 3:53 am #215425In reply to: bbPress registration email confirmation
Robin W
ModeratorOctober 24, 2020 at 12:59 pm #215413In reply to: WooCommerce Hiding Admin Bar for bbPress Moderators
Robin W
Moderatorok, a couple of thoughts just looking at that code
The first would be to break it into a function, nested stuff can sometimes fail so
add_action('init', 'rew_check_bbpress_moderator') ; function rew_check_bbpress_moderator(){ if(class_exists('WooCommerce') && function_exists('bbp_get_user_role') && is_user_logged_in()){ $current_user = wp_get_current_user(); $user_id = $current_user->ID; $bbp_get_user_role = bbp_get_user_role($user_id); if($bbp_get_user_role == 'bbp_keymaster' || $bbp_get_user_role == 'bbp_moderator'){ add_filter( 'woocommerce_prevent_admin_access', '__return_false' ); add_filter( 'woocommerce_disable_admin_bar', '__return_false' ); } } }Secondly I think woocommerce is all lower case so
if(class_exists('WooCommerce')might need to read
if(class_exists('woocommerce')Let us know if either of these help
October 24, 2020 at 12:32 am #215402Topic: WooCommerce Hiding Admin Bar for bbPress Moderators
in forum Troubleshootingsamtime
ParticipantHi,
After updating WooCommerce to the latest version (4.6.1), the plugin is now hiding the WordPress admin bar for bbPress moderators and keymasters. Making it harder for them to moderate the forums.The following code in my functions.php file used to resolve the issue, however it no longer works:
add_action('init', function(){ if(class_exists('WooCommerce') && function_exists('bbp_get_user_role') && is_user_logged_in()){ $current_user = wp_get_current_user(); $user_id = $current_user->ID; $bbp_get_user_role = bbp_get_user_role($user_id); if($bbp_get_user_role == 'bbp_keymaster' || $bbp_get_user_role == 'bbp_moderator'){ add_filter( 'woocommerce_prevent_admin_access', '__return_false' ); add_filter( 'woocommerce_disable_admin_bar', '__return_false' ); } } });I posted this question to the WooCommerce forums and am also posting it here in case anyone else is having similar problems?
Any help or ideas greatly appreciated.
Thank you,
SamWordPress 5.5.1
bbPress 2.6.5
WooCommerce 4.6.1October 21, 2020 at 4:28 am #215351In reply to: Display Logged in User’s Subscribed Topics
josh.grisdale
ParticipantHi,
Looking for the same thing, but to show subscribed forums…
Can your code be changed for that?
October 20, 2020 at 10:03 pm #215344Topic: Shortcode for my subscriptions
in forum Troubleshootingjosh.grisdale
ParticipantHello,
I want to create a widget for the sidebar of my site that shows the current user’s subscribed forums. (Like when you go to the user profile, you can see a list of subscribed forums, I want to have that list in a sidebar widget.)
Is there a shortcode that could do this? Like:
[bbp-forum-index id=$subscribed]October 17, 2020 at 9:02 pm #215260matgargano
ParticipantI see that
bbp_get_user_rewrite_id()exists, but there’s no filter in it. Is it possible to override that and have it use display name?October 17, 2020 at 8:56 pm #215259Topic: change user slug for profile page to use display-name
in forum Troubleshootingmatgargano
ParticipantHi, currently the user slug for my site is:
https://domain.com/forums/users/first-last/ (it may not be exactly first-last, but it’s not what i ultimately want it to be).
I want that to be: https://domain.com/forums/users/{display-name}/
and it to change if the user changes their display name (301s aside, let’s not worry about old links to their profile that may exist)
Is this possible out of the box? or via some method (code, plugin, etc)
October 16, 2020 at 7:29 am #215249In reply to: TinyMCE editor without html tags
Robin W
Moderatortry adding this to your theme’s custom css, or the custom css tab of style pack
.mce-ico { background: transparent center center !important; color: #595959 !important; }you might need to play with the color to get what you want
October 16, 2020 at 3:28 am #215241In reply to: full width and remove sidebar
albertoe
ParticipantThanks Robin, I check that a bbpress.php was created with this code:
<?php get_header(); ?> <div class="td-main-content-wrap td-main-page-wrap td-container-wrap"> <div class="td-container"> <div class="td-pb-row"> <div class="td-pb-span8 td-main-content"> <div class="td-ss-main-content"> <?php if (have_posts()) { while ( have_posts() ) : the_post(); ?> <h1 class="entry-title td-page-title"> <a href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title_attribute() ?>"><?php the_title() ?></a> </h1> <?php the_content(); endwhile; //end loop } ?> </div> </div> <div class="td-pb-span4 td-main-sidebar"> <div class="td-ss-main-sidebar"> <?php dynamic_sidebar( 'td-default' ) ?> </div> </div> </div> <!-- /.td-pb-row --> </div> <!-- /.td-container --> </div> <?php get_footer(); ?>And I change with for this code:
<?php get_header(); ?> <div class="td-main-content-wrap td-main-page-wrap td-container-wrap"> <div class="td-container"> <div class="td-pb-row"> <div class="td-pb-span8 td-main-content"> <div class="td-ss-main-content"> <?php if (have_posts()) { while ( have_posts() ) : the_post(); ?> <h1 class="entry-title td-page-title"> <a href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title_attribute() ?>"><?php the_title() ?></a> </h1> <?php the_content(); endwhile; //end loop } ?> </div> </div> </div> <!-- /.td-pb-row --> </div> <!-- /.td-container --> </div> <?php get_footer(); ?>I refresh cache but nothing happends. Any idea?
October 16, 2020 at 3:11 am #215240In reply to: full width and remove sidebar
October 15, 2020 at 12:30 pm #215221In reply to: Copy in the new registration email?
Robin W
Moderatorbbpress just uses wordpress signup, so whatever your WordPress site is using.
There are several plugins that will let you change this email eg
https://www.wpbeginner.com/plugins/how-to-send-a-custom-welcome-email-to-new-users-in-wordpress/
or if you’re into coding, just google around to find some code
October 14, 2020 at 7:35 am #215197In reply to: Enable Mention Auto Suggest
wjh
Participant- WordPress 5.4.2
- bbpress 2.6.5
- Buddypress 6.3.0 w/ Activities module activated
- bbp Style pack w/ both form editors (TinyMCE + text) activated
- bbp Mentions suggest
The bbp Mentions suggest plugin by the venerable @robin-w still works and enables autocomplete mentions in TinyMCE as well as in the Text (HTML) tab of the editor … but only on initial page load, since bbpress 2.6.2.
Since bbpress 2.6.2, when clicking on Reply to a specific comment on a subject thread, the dynamic reply form now appears under the comment in question, and the window scrolls to it. Which is a very nice improvement! However, this breaks Robin’s plugin for the TinyMCE editor (mentions do still autocomplete in the Text editor, at least).
I’m not a developer but I’m guessing it has to do with the new version of /bbpress/templates/default/js/reply.js, specifically the
addEditorfunction at the end of the file.
@robin-w any ideas how to get your plugin to play nice with the dynamic reply form in bbpress ≥2.6.2?Or anyone else out there?
Cheers in advance!
October 13, 2020 at 9:11 pm #215194patriciaraelinn
ParticipantJust need help with this… If I have to go into the CSS to make it work, please give me SPECIFIC instructions as I do’t code. Thank you.
-
AuthorSearch Results