Search Results for 'code'
-
AuthorSearch Results
-
April 30, 2020 at 2:55 am #210639
In reply to: One Off Identities or Posting As Multiple Users
Robin W
Moderatornothing exists as far as I know. Like everything it could be coded, but beyond free help.
April 29, 2020 at 12:53 pm #210623Robin W
Moderatorok, this may or may nogt work
can you download this file
and then open it and paste the contents into code snippets ion the php/code section
then let me know if it does anything (at all!!)
April 29, 2020 at 11:02 am #210622Robin W
Moderatorok, let me play with some code and come back
April 29, 2020 at 10:08 am #210621Lars Henriksen
ParticipantHi Robin
Thanks for answering.
If ‘technical’ means able to fiddle with readymade code snippets, then yes.
If it means actual coding skills, the no 🙂Lars
April 28, 2020 at 12:42 pm #210592In reply to: removing the sidebar
Robin W
Moderatorone of the most annoying things in bbpress and a regular topic !
item 8 is your starting point
come back if you need further help
April 28, 2020 at 10:41 am #210586In reply to: Rename heading?
Robin W
Moderatorcreate a page called ‘whatever’ and put the code
[bbp-forum-index]in it
foren will become ‘whatever’
April 27, 2020 at 1:47 pm #210557In reply to: Pagination after deleting posts
wilc097
ParticipantI’m sorry , it does not indeed.
Edit: I’m sorry, I now understand the 3 and the 10 are add_filter inputs to set priority and number of arguments…
Your code works, thanks a lot. I have been to fast in my replies without proper testing.
April 27, 2020 at 1:27 pm #210554In reply to: Pagination after deleting posts
wilc097
ParticipantI have been looking at the function more closely, and think the correct code is as follows:
add_filter ('bbp_get_reply_position' , 'rew_redo_reply_position') ; function rew_redo_reply_position ($reply_id=0, $topic_id=0) { // Get required data $reply_id = bbp_get_reply_id( $reply_id ); // Get topic ID $topic_id = ! empty( $topic_id ) ? bbp_get_topic_id( $topic_id ) : bbp_get_reply_topic_id( $reply_id ); // Post is not the topic if ( $reply_id !== $topic_id ) { $reply_position = bbp_get_reply_position_raw( $reply_id, $topic_id ); // Update the reply position in the posts table so we'll never have // to hit the DB again. if ( ! empty( $reply_position ) ) { bbp_update_reply_position( $reply_id, $reply_position ); } // Topic's position is always 0 } else { $reply_position = 0; } // Bump the position by one if the topic is included in the reply loop if ( ! bbp_show_lead_topic() ) { $reply_position++; } // Filter & return return (int) apply_filters( 'rew_redo_reply_position', $reply_id, $topic_id ); }April 27, 2020 at 11:11 am #210549In reply to: Pagination after deleting posts
Robin W
Moderatoryes, the function seems to look up the reply position and if it exists, does not change it
Put this in your child theme’s function file – or use
add_filter ('bbp_get_reply_position' , 'rew_redo_reply_position', 10 , 3 ) ; function rew_redo_reply_position ($reply_position, $reply_id, $topic_id) { // Get required data $reply_id = bbp_get_reply_id( $reply_id ); // Get topic ID $topic_id = ! empty( $topic_id ) ? bbp_get_topic_id( $topic_id ) : bbp_get_reply_topic_id( $reply_id ); // Post is not the topic if ( $reply_id !== $topic_id ) { $reply_position = bbp_get_reply_position_raw( $reply_id, $topic_id ); // Update the reply position in the posts table so we'll never have // to hit the DB again. if ( ! empty( $reply_position ) ) { bbp_update_reply_position( $reply_id, $reply_position ); } // Topic's position is always 0 } else { $reply_position = 0; } // Bump the position by one if the topic is included in the reply loop if ( ! bbp_show_lead_topic() ) { $reply_position++; } // Filter & return return (int) apply_filters( 'rew_redo_reply_position', $reply_position, $reply_id, $topic_id ); }and come back with whether that fixes, it may not retro fix, so you may need to delete another reply to get it to work.
Robin W
Moderatorno not that file, the functions file in your child theme. If you don’t have a child theme, or don’t know what that means, use the code snippets plugin.
Scordisian
ParticipantThnx for the quick reply. Just to make sure, you mean the bbpress-functions.php file right?
Also, I noticed some other pieces of code that are not directly found in the template files like these. So a seperate bbpress file might be very handy.
Robin W
ModeratorPut this in your child theme’s function file – or use
and change “bbp-topic-tags” to whatever you want
add_filter ('bbp_before_get_topic_tag_list_parse_args' , 'rew_change_class' ) ; function rew_change_class ($args) { $args['before'] = '<div class="bbp-topic-tags"><p>' . esc_html__( 'Tagged:', 'bbpress' ) . ' ' ; return $args ; }Scordisian
ParticipantHello,
I was wondering. The following
<?php bbp_topic_tag_list(); ?>
call the tags from what I can see. But where can I change the precedingclass="bbp-topic-tags".I want to change the class name.
Thnx.
April 27, 2020 at 5:44 am #210526Robin W
Moderatoradd_shortcode (‘kiki-greet’ , ‘kiki_greet’ ) ; function kiki_greet() { $user = wp_get_current_user() ; echo '<div="kiki-greet">'.$user->display_name.'</div>' ; }try again
April 27, 2020 at 5:42 am #210525Kikis
ParticipantI got an error why using the code
April 27, 2020 at 5:36 am #210521Robin W
Moderatorwrap it in some
<div>‘sadd_shortcode (‘kiki-greet’ , ‘kiki_greet’ ) ; function kiki_greet() { $user = wp_get_current_user() ; echo '<div="kiki-greet">.$user->display_name.'</div> ; }then style the div name (which can be anything unique – I just called it kiki-greet)
April 27, 2020 at 5:10 am #210518Kikis
ParticipantI’m trying to add css tag to this code but could not
add_shortcode (‘kiki-greet’ , ‘kiki_greet’ ) ;
function kiki_greet() {
$user = wp_get_current_user() ;
echo $user->display_name ;
}I want to style the name
April 27, 2020 at 3:44 am #210515In reply to: [bbp-single-forum id] for parent not working
adamgby
ParticipantYes exactly. Unfortunately, I did a lot of things on the site. I updated plugins, theme, installed new plugins (WooCommerce). I remembered now that I was adding code to functions.php. Code that disables the address fields when a customer buys a virtual product. I’ll check it when I’m at the computer.
I also changed the database password.I have a backup from April 14. I restored plugins files from this copy yesterday. After that, two subforums appeared in each parent forum.
I will continue working today.
April 27, 2020 at 3:06 am #210511In reply to: Topic headings to show only
Robin W
Moderatorinstall
once activated go to
dashboard>settings>bbp style pack>Forum Display and add item 6
then
dashboard>settings>bbp style pack>custom css and add
.bbp-forum-info .bbp-forum-content { display: none !important; }April 26, 2020 at 5:13 pm #210503In reply to: Is there a way to display users with highest topics
Robin W
Moderatorso can you give us the code so far please
April 26, 2020 at 1:15 pm #210496In reply to: Is there a way to display users with highest topics
Robin W
Moderatoryou need to learn how to look at classes in ‘developer’ in your browser, and then you can do all this yourself.
an example of the relevant image code is
<div class="tc-avatar" style="float:left;border-radius: 25px;"><a class="tc-profile-link" href="http://gos.rewweb.co.uk/users/admin/"><img alt="" src="https://secure.gravatar.com/avatar/dd803ad797ee5ca256d4be78c98fb305?s=96&d=mm&r=g" srcset="https://secure.gravatar.com/avatar/dd803ad797ee5ca256d4be78c98fb305?s=192&d=mm&r=g 2x" class="avatar avatar-96 photo" width="96" height="96"></a></div>and the text
<div class="tc-content" style="padding-left:50px ; top: 50%;transform: translateY(-50%);position: relative;"><a class="tc-profile-link" href="http://xxx.com/users/admin/">admin</a>303</div>April 26, 2020 at 12:25 pm #210492In reply to: Is there a way to display users with highest topics
Kikis
ParticipantI got an error why using your shortcode
April 26, 2020 at 10:34 am #210488In reply to: Is there a way to display users with highest topics
Robin W
ModeratorApril 26, 2020 at 3:50 am #210485In reply to: Testing user privileges
Chuckie
ParticipantThanks. Only mistake there is that you forgot to insert your corrected
editterms into theifstatement. 🙂Thanks alot.
April 25, 2020 at 5:26 pm #210481In reply to: Testing user privileges
Robin W
Moderatorbbpress uses
edit_topicsandedit_repliesso doesn’t use the capabilities abovebut suspect your code needs an if statement, so I’d do
// check frontend user privileges if ( is_user_logged_in() && ( (current_user_can('edit_posts') || current_user_can('edit_pages') ) ) $canEdit = true ; -
AuthorSearch Results