Search Results for 'code'
-
AuthorSearch Results
-
March 28, 2016 at 2:10 am #173518
pattz2016
ParticipantI am using BBpress recent topic widget and i reaslied that it only gives me an option of adding topic author and date. How can i add the recent answers category like it is on this forum? Is there a Plugin for that? If there is not, is there a code i can fix in my templates to get this fuctionality?
Many thanks,
March 28, 2016 at 1:41 am #173517In reply to: Uploading images without placing the text
elovkoff
ParticipantHi Rob, thanks for the advice. And thanks to everybody else who took the time to chime in.
You said: “Also I cannot seem to find the code in the bbPRess plugin responsibe for the no redirect to post after submit after using using this code.”
Anny pointers where would I look for it, or should I hire a dev to do that?When you refer to inline image upload – is that something that would require users to know how to use img html tags? Will it allow multiple image upolads too?
Thank you.
Elijah.March 27, 2016 at 8:57 pm #173509TKServer
ParticipantOk @tech55541 I’ve just added a short code option! See if you can get it to work!
March 27, 2016 at 4:24 pm #173505TKServer
ParticipantNice plugin you created. Do you think it would be possible to create shortcodes in the next update? My theme is so old it does not have widget areas LOL.
Thanks, cool plugin BTW.
That’s an interesting suggestion. It would not be hard but for the settings. Since the widget settings are set inside the widget itself, I’d have to redo the settings and make them part of the plugin settings.
I’ll see what I can do…
March 27, 2016 at 3:50 pm #173502tech55541
ParticipantHey @tkserver,
Nice plugin you created. Do you think it would be possible to create shortcodes in the next update? My theme is so old it does not have widget areas LOL.Thanks, cool plugin BTW.
March 27, 2016 at 3:46 pm #173501tech55541
ParticipantHello,
It is more than likely custom coded.Thanks.
March 27, 2016 at 2:20 pm #173498In reply to: How to change/create fourm roles
olliewe88
Participanthi again @robin-w
Ok so I have put the code below in the functions.php
function add_new_roles( $bbp_roles )
{
/* role the new role*/
$bbp_roles[‘bbp_Facepainter’] = array(
‘name’ => ‘Facepainter’,
‘capabilities’ => custom_capabilities( ‘bbp_Facepainter’ )
);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_Facepainter’ )
$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 ‘Facepainter’ role */
case ‘bbp_Facepainter’:
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’ => true,
‘read_hidden_forums’ => false,// Topic caps
‘publish_topics’ => true,
‘edit_topics’ => true,
‘edit_others_topics’ => false,
‘delete_topics’ => false,
‘delete_others_topics’ => false,
‘read_private_topics’ => true,// Reply caps
‘publish_replies’ => true,
‘edit_replies’ => true,
‘edit_others_replies’ => false,
‘delete_replies’ => false,
‘delete_others_replies’ => false,
‘read_private_replies’ => true,// Topic tag caps
‘manage_topic_tags’ => false,
‘edit_topic_tags’ => false,
‘delete_topic_tags’ => false,
‘assign_topic_tags’ => true,
);break;
default :
return $role;
}
}}However, it is still not working. It shows when I go to Users,user,Forum Role and set it to facepainter but when I save it, it still doesn’t set their fourm role to face painter?!
Thanks for you help
March 27, 2016 at 1:14 pm #173495In reply to: How to change/create fourm roles
Robin W
Moderatorthe code is additional and goes in your functions.php
see
March 27, 2016 at 11:16 am #173492In reply to: Add link to Unsolved topics
tech55541
ParticipantHello,
That code worked great. Could you please help me make another view for solved topics?I almost did it myself, but I do not know what or how to find the meta_value that I need.
Thanks for your help.
March 27, 2016 at 10:24 am #173489In reply to: How to put the post box on top?
tech55541
Participant@robkk, I am quite a new coder, I will have to test it later and figure out what is wrong.
Thanks.
March 27, 2016 at 9:13 am #173487In reply to: How to change/create fourm roles
olliewe88
ParticipantThank you however for the link above where do you find the code to edit @robin-w
March 27, 2016 at 7:47 am #173484In reply to: How to change/create fourm roles
Robin W
ModeratorMarch 27, 2016 at 6:23 am #173481In reply to: Add link to Unsolved topics
Robkk
ModeratorYou can create a custom view, use this shortcode in a page
[bbp-single-view id='unresolved'], then just link to it in a menu or use the views widget bbPress provides.function rkk_register_unresolved_view() { bbp_register_view( 'unresolved', __( 'Unresolved Topics' ), array( 'meta_key' => 'bbr_topic_resolution', 'meta_value' => '2', 'orderby' => 'post_date', 'post_status' => 'publish' ), false ); } add_action( 'bbp_register_views', 'rkk_register_unresolved_view' );March 27, 2016 at 5:38 am #173480In reply to: how to add specific left/right sidebar
Pascal Casier
ModeratorStarting from this can help : https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#26-creating-a-bbpress-specific-sidebar
Pascal.
March 27, 2016 at 5:36 am #173479In reply to: How to put the post box on top?
Robkk
ModeratorDo what @casiepa said and just put the bbPress template
content-single-forum.phpin a folder called bbpress in your child theme, and edit the file.A guide like this would help you figure out how you can customize the bbPress default theme in a child theme.
https://codex.bbpress.org/themes/theme-compatibility/
Just make your file look similar to this gist.
https://gist.github.com/robkk/059c1f87b3d21cf75dd9
@tech55541 thanks for helping out in a few topics in the support forums, but your code shows undefined messages in the user profile subscriptions section if you are subscribed to a forum.March 27, 2016 at 5:26 am #173478In reply to: WordPress /author/ page and bbPress /user/ page
Pascal Casier
Moderator$current_user = wp_get_current_user(); $user_id = $current_user->ID; if ( 0 == $user_id ) { // Not logged in. } else { // code from previous thread, use function like bbp_get_user_topic_count_raw($user_id) }Not tested ! But should be in that direction…
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 26, 2016 at 9:41 pm #173469In reply to: How to put the post box on top?
tech55541
ParticipantHello,
Please insert this code in a mu-plugin. Using FTP, create a folder named “mu-plugins” in the /wp-content directory without the quotes. Then create a file named what ever you want with a .php extention. For example, example-plugin.php.<?php add_action( 'wp_footer', 'reposition_selector' ); function reposition_selector() { ?> <script type="text/javascript"> jQuery( document ).ready(function() { var htmlString = jQuery('.bbp-topic-form').html(); jQuery('.bbp-topic-form').css('display','none'); jQuery( "<div class='bbp-topic-form'>"+htmlString+"</div>" ).insertBefore( "#subscription-toggle" ); }); </script> <?php }Thanks.
March 26, 2016 at 6:47 pm #173467In reply to: How to put the post box on top?
bj87
ParticipantHelp the last time, where should i paste that code you wrote in?
March 26, 2016 at 5:57 pm #173466In reply to: How to put the post box on top?
bj87
ParticipantSo where should i place that code again?
It looks like this in my footer.php at the end, already another script also…
// Echo the scripts added to the "before </body>" field in Theme Options echo Avada()->settings->get( 'space_body' ); ?> <!--[if lte IE 8]> <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/assets/js/respond.js"></script> <![endif]--> </body> </html>March 26, 2016 at 5:57 pm #173465In reply to: How to put the post box on top?
tech55541
ParticipantHello,
I would just edit the template, I could not make my code work either.Thanks.
March 26, 2016 at 4:59 pm #173456Topic: how to add specific left/right sidebar
in forum Themeschaya579
Participanti’m used with Content Aware Sidebars to create dynamic sidebars but its not work for bbpress form.
how can i add specific to bbpress forms?tried to add code to bbpress.php and to sidebar.php but still can not add sidebars on bbpress.
thanks
March 26, 2016 at 4:51 pm #173455In reply to: How to put the post box on top?
tech55541
ParticipantHello,
You could try something like this. Place this code before the ending</html>tag in your footer.php file of your theme.<script> jQuery($('.bbp-topic-form').insertAfter('#subscription-toggle'); </script>March 26, 2016 at 4:12 pm #173452In reply to: How to put the post box on top?
Pascal Casier
ModeratorHi Johan, goede avond,
I suppose you can copy the content-single-forum.php to your own child theme and modify it accordingly.
https://codex.bbpress.org/themes/theme-compatibility/step-by-step-guide-to-creating-a-custom-bbpress-theme/Pascal.
March 26, 2016 at 2:25 pm #173448In reply to: Uploading images without placing the text
Robkk
ModeratorYou do not have to create a child theme just for custom code snippets, you can also use a custom plugin, this plugin below will give you an area to add custom php code snippets.
https://wordpress.org/plugins/functionality/
I still rather suggest you just stick with an inline image upload plugin instead of gd bbPress attachments(unless you are using pro), instead of removing the error notice and allowing empty replies.
-
AuthorSearch Results