Search Results for 'code'
-
AuthorSearch Results
-
August 29, 2015 at 12:47 am #166011
In reply to: Forum won’t load in Safari
Robkk
ModeratorTry some troubleshooting first if you haven’t already, check your cache(this includes browser cache if the main browser you use is safari).
August 29, 2015 at 12:45 am #166010In reply to: Replies cutting off
Robkk
Moderator#bbpress-forums .reply { margin-left: 0 !important; width: auto !important; }August 28, 2015 at 10:34 pm #166004For Games
ParticipantHello, everybody, this is my resolution:
first, i have my own plugin, named ‘sc64’. then add these php code to my plugin.add_filter('bbp_get_do_not_reply_address','scap_bbp_no_reply_email'); function scap_bbp_no_reply_email(){ $admin_email = get_option('admin_email'); return $admin_email; }the default noreply email address has changed to admin_email that configured in wordpress.
i hope this helps.
August 28, 2015 at 9:07 pm #166000In reply to: Add/Change User roles
Robkk
Moderatorat the very end of this function
function custom_capabilities( $role )You see this
); break; default : return $role; }Well your missing a
}at the very end.the end of the function should look like this.
); break; default : return $role; } }August 28, 2015 at 8:36 pm #165999Topic: Freshness incorrect on edited post
in forum Troubleshootinggeog272
ParticipantHi there, when editing a post, I choose the “log this edit” checkbox. After editing, I get something like the following listed beneath the topic text:
This topic was modified 1 month, 3 weeks ago by lxxx@gmail.com.
This topic was modified 29 seconds ago by lxxx@gmail.com.However, the “freshness” is still listed as the first (older) time and therefore the sort order in the recent topics shortcode page doesn’t change — so a recently edited post doesn’t float to the top of the list. Is there anything I can do to fix this?
Thanks!
August 28, 2015 at 8:23 pm #165998In reply to: Deactive the Open Graph option in Yoast SEO
Robkk
ModeratorWell thing is having meta tags shouldn’t really affect bbPress at all. And I was figuring it may be how something is configured in their plugin that is causing issues.
<meta property="og:title" content="The Rock" /> <meta property="og:type" content="video.movie" /> <meta property="og:url" content="http://www.imdb.com/title/tt0117500/" /> <meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />Or are you saying that the meta tags do not work on bbPress forums, but the bbPress forums work fine??
August 28, 2015 at 4:11 pm #165982Topic: Contact form – native or plugin?
in forum PluginsBrovashift
ParticipantHi, still setting things up here…
I was just wondering if there was a shortcode or something to add a contact for to my forum?
My site just has a contact page already created, with the text: [contact-form-7 id=”4″ title=”Contact Form”]. But I don’t see that plugin installed.
I would prefer to add a contact form / widget natively if possible. If not, is contact form 7 plugin the way to go?
Thanks guys!
August 28, 2015 at 8:08 am #165975Mei Ling
ParticipantIf 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.
August 28, 2015 at 7:48 am #165973In reply to: Add/Change User roles
sbskamey
ParticipantHi Robkk, I’d like to change the capabilities for the roles, so I think adding the new roles would be better.
When I move my code to my Child Theme, my website goes blank.
Do you know if theres something that I’m missing?
This is my Child Theme with the 3 new role and new capabilities in it… (when I add this code to the core bbpress files, it works, but now that I moved it to my Child Theme, my site goes blank).
<?php // enqueue the child theme stylesheet Function wp_schools_enqueue_scripts() { wp_register_style( 'childstyle', get_stylesheet_directory_uri() . '/style.css' ); wp_enqueue_style( 'childstyle' ); } add_action( 'wp_enqueue_scripts', 'wp_schools_enqueue_scripts', 11); //code to add roles function add_new_roles( $bbp_roles ) { /* Add a role called team member */ $bbp_roles['bbp_teammember'] = array( 'name' => 'Team Member', 'capabilities' => custom_capabilities( 'bbp_teammember' ) ); /* Add a role called teammember */ $bbp_roles['bbp_communitymember'] = array( 'name' => 'Community Member', 'capabilities' => custom_capabilities( 'bbp_communitymember' ) ); /* Add a role called ambassador */ $bbp_roles['bbp_ambassador'] = array( 'name' => 'Ambassador', 'capabilities' => custom_capabilities( 'bbp_ambassador' ) ); return $bbp_roles; } add_filter( 'bbp_get_dynamic_roles', 'add_new_roles', 1 ); function add_role_caps_filter( $caps, $role ) { /* Only filter for roles we are interested in! */ if( $role == 'bbp_teammember' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_communitymember' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_ambassador' ) $caps = custom_capabilities( $role ); return $caps; } add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 ); function custom_capabilities( $role ) { switch ( $role ) { /* Capabilities for 'teammember' role */ case 'bbp_teammember': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => true, 'throttle' => true, 'view_trash' => true, // Forum caps 'publish_forums' => true, 'edit_forums' => true, 'edit_others_forums' => true, 'delete_forums' => true, 'delete_others_forums' => true, 'read_private_forums' => true, 'read_hidden_forums' => true, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => true, 'delete_topics' => true, 'delete_others_topics' => true, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => true, 'delete_replies' => true, 'delete_others_replies' => true, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => true, 'edit_topic_tags' => true, 'delete_topic_tags' => true, 'assign_topic_tags' => true, ); /* Capabilities for 'communitymember' role */ case 'bbp_communitymember': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => false, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => true, 'edit_topics' => false, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => false, // Reply caps 'publish_replies' => true, 'edit_replies' => false, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => false, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => true, ); /* Capabilities for 'ambassador' role */ case 'bbp_ambassador': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => false, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => true, 'edit_topics' => false, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => false, // Reply caps 'publish_replies' => true, 'edit_replies' => false, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => false, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => true, ); break; default : return $role; }August 28, 2015 at 3:21 am #165968sivaramapandian
Participanthi friends,
Me too, breadcrumb is not showing only in forum pages.
Previously i had WordPress SEO plugin. Now disabled that too. But still i am not getting breadcrumb. No code is done. Latest bbpress has been installed as it is.
Please help
Thanks
August 27, 2015 at 9:45 pm #165953Robkk
ModeratorIts some pagination code inherited from the template bbPress is using for its pages.
You might need to create a bbpress.php file from the file bbPress is inheriting from and place it in your child theme and also remove any post meta like the by that is usually for displaying the author of a blog post.
If you are using Genesis, I think installing the bbPress Genesis Extend plugin will solved most bbPress layout issues.
August 27, 2015 at 8:43 pm #165949In reply to: Add/Change User roles
Robkk
Moderatorthis is great. thanks Robkk. Just one question… Do I put this into the bbpress.php file in the bbpress folder?
No. Also the bbpress.php file should be in the root of your theme.
I added it here: wp-content/plugins/bbpress/templates/default/bbpress
Just checking if that is correct?
Don’t mess with any core files.
Okay so I put the above code in here and it seems to work:
plugins > bbpress > includes > users
Again, just checking if that is correct?
Don’t mess with any core files.
Here, I forgot I did this a while back. Add this to your functions.php file in your child theme.
function rk_show_role_classes($classes) { $replyid = bbp_get_reply_author_id(); $bbp_get_role = bbp_get_user_display_role($replyid); $bbp_display_role = strtolower($bbp_get_role); $classes[] = $bbp_display_role; return $classes; } add_filter( 'bbp_get_topic_class','rk_show_role_classes' ); add_filter( 'bbp_get_reply_class','rk_show_role_classes' );Do the CSS I said before for the above code.
It would be something like this but for each role.
.ambassador .bbp-author-role { background-color: blue; }And if you do not need custom roles but instead just role names, lets say for each role it would be like this.
Keymaster -> Ambassador
Moderator -> Team Member
Participant -> Community MemberYou can just change the role names using this function. Add it to your child themes functions.php file. And rename My Custom Role to what you want.
add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' ); function ntwb_bbpress_custom_role_names() { return array( // Keymaster bbp_get_keymaster_role() => array( 'name' => 'My Custom Keymaster Role Name', 'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) ), // Moderator bbp_get_moderator_role() => array( 'name' => 'My Custom Moderator Role Name', 'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) ), // Participant bbp_get_participant_role() => array( 'name' => 'My Custom Participant Role Name', 'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) ), // Spectator bbp_get_spectator_role() => array( 'name' => 'My Custom Spectator Role Name', 'capabilities' => bbp_get_caps_for_role( bbp_get_spectator_role() ) ), // Blocked bbp_get_blocked_role() => array( 'name' => 'My Custom Blocked Role Name', 'capabilities' => bbp_get_caps_for_role( bbp_get_blocked_role() ) ) ); }Oh and quit trying to copy Ultimate Members site, try to have a unique website.
August 27, 2015 at 5:57 pm #165942Brovashift
ParticipantHi Robkk,
Thanks for getting back to me re my login/reg issue.
The plugin you sent looks good, but ideally Id like to handle the login/registration natively.
I have added the bbp-login / bbp-register on a single page, which works to some extent, looks kinda basic. But its not contained in a nice neat pop-up box like here in bbpress’s sub-header bar.
More importantly, there is no Logout! Do I need another shortcode for that? [bbp-logout] maybe?
Thanks for your help
Rob
August 27, 2015 at 11:20 am #165936vcb
ParticipantWhy does the forum only show up when I update it manually via backend?
Anyone any idea what this could be?I’ve tried different roles; Moderator + Keymaster. Still getting the same result, everything does work – beside showing it in the frontend.Tho, after updating the forum within the backend it shows up in the frontend.
Thanks.
// Create FORUM Entry object $my_forum = array( 'post_title' => 'title', 'post_content' => 'test', 'post_status' => 'private', 'post_author' => $_POST['post_author'], //also tried admin '1', 'post_type' => 'forum', 'post_parent' => '123' // parent forum ); // Insert the post into the database $page_id = wp_insert_post( $my_forum );August 27, 2015 at 5:09 am #165930In reply to: Add/Change User roles
sbskamey
ParticipantOkay so I put the above code in here and it seems to work:
plugins > bbpress > includes > users
Again, just checking if that is correct?
Now to change the background colours, god that’s gonna take me another 2 days! :p
August 26, 2015 at 10:09 pm #165917Robkk
ModeratorHmm that seems like a peice of code that has been posted on these forums before. Hopefully other users do not come across the same issue.
I am glad that you resolved your own issue though. 🙂
Are you using the WP Admin No show plugin? This is a plugin I usually recommend for users to use instead.
August 26, 2015 at 9:28 pm #165914In reply to: How to remove field in bbpress?
Robkk
Moderatorcopy
form-anonymous.phpin your child theme and remove this in the file.<p> <label for="bbp_anonymous_website"><?php esc_html_e( 'Website:', 'bbpress' ); ?></label><br /> <input type="text" id="bbp_anonymous_website" value="<?php bbp_author_url(); ?>" size="40" name="bbp_anonymous_website" /> </p>August 26, 2015 at 9:03 pm #165912CraftyMc
ParticipantI debugged my site and found the culprit, it would appear my site didn’t like my custom function,
function baw_no_admin_access() { if( !current_user_can( 'administrator' ) ) { wp_redirect( home_url() ); } } add_action( 'admin_init', 'baw_no_admin_access', 1 );Iv’e now removed it and use a plugin to block access to the dashboard. 🙂
August 26, 2015 at 8:57 pm #165911Robkk
ModeratorTry some troubleshooting it could be your theme conflicting with bbPress. Try a default theme temporarily to see if is in fact bbPress causing the issue with any scripts.
Contact the theme author if it just your theme, and see if they have a fix for users that want to use bbPress.
The debug information you got is explained here.
August 26, 2015 at 8:48 pm #165910Robkk
ModeratorAny plugin that hooks into the default WordPress registration and adds special fields should add fields also to the bbPress registration form.
A plugin like this could add extra fields.
https://wordpress.org/plugins/cimy-user-extra-fields/
This site uses the [bbp-login] shortcode and there is a message on the registration page that says this site uses the same registration details as WordPress.org.
August 26, 2015 at 5:26 pm #165906Brovashift
ParticipantHi all,
Just setting up my new forum using the latest versions of wordpress and bbpress, but Im having trouble handling user registration.
Ive used the forum login widget to handle logins in my sidebar, but im not happy with registration. I created a new page called registration and added the shortcode [bbp-register]. But this is really basic and not what a am looking for at all, unless its possible to edit it somehow, something I am fairly sure cannot be done to a shortcode?
Does anyone have any suggestion as to what login and registration plugins are good to use? Or anyone know what this bbpress site uses to handle its login and registrations, that looks good handling both functions in one tidy box in a single area.
Thanks for you help in advance.
🙂
August 26, 2015 at 5:23 pm #165905CraftyMc
ParticipantHello, I’m having some issues with bbpress, when i activate the plugin all the ajax / jquery features fail to work i.e add to watchlist button, posts, maps, and anything that uses scripts to load.
Has anyone experianced this or know the cause, I enabled debug and it gives me this error, not sure if it’s linked,
Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /wp-includes/functions.php on line 3622At the moment I cannot use the plugin as my site uses a lot of scripts to load the features.
Let me know if you’re able to help. Thanks
August 26, 2015 at 3:13 pm #165899In reply to: my activity in the fourm isnt showing up
Robkk
ModeratorWhat troubleshooting did you already do? Did you already do the plugin and theme troubleshooting?
Also sometimes it may not necessarily be a caching plugin, it could also be other thing caching your site, like cloudflare, hosting server cache, something like that.
You can always test your sites theme/plugins on a test server.
August 26, 2015 at 12:09 pm #165880In reply to: bbpress not logout
W-P-Zar
Participantthe add_filter( ‘logout_url’, ‘bbp_logout_url’, 2, 2 );
filter bbp_logout_url in logout_url
function bbp_logout_url() call apply_filters inside the function
so
if remove_filter remove the filter but it is already apply
it’s like that???
precarious resolved
my own plugin or in function.php
add_filter( 'logout_url', 'my_logout_page', 10, 2 ); function my_logout_page( $logout_url, $redirect ) { $logout_url = str_replace('%3Floggedout%3Dtrue', '', $logout_url); return $logout_url; }August 26, 2015 at 12:11 am #165870In reply to: bbpress not logout
Robkk
ModeratorI get that you are sorry for your English haha you don’t have to keep telling me 🙂
Okay try adding this to your child themes function.php file to see if this helps solve your issue, but try just logging out from the WordPress Toolbar only for now.
remove_filter( 'logout_url', 'bbp_logout_url' ); -
AuthorSearch Results