Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 2,876 through 2,900 (of 32,517 total)
  • Author
    Search Results
  • #210586

    In reply to: Rename heading?

    Robin W
    Moderator

    create a page called ‘whatever’ and put the code
    [bbp-forum-index]

    in it

    foren will become ‘whatever’

    #210557
    wilc097
    Participant

    I’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.

    #210554
    wilc097
    Participant

    I 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 );
    }
    #210549
    Robin W
    Moderator

    yes, 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

    Code Snippets

    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.

    #210539

    In reply to: Tag html

    Robin W
    Moderator

    no 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.

    #210537

    In reply to: Tag html

    Scordisian
    Participant

    Thnx 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.

    #210536

    In reply to: Tag html

    Robin W
    Moderator

    Put this in your child theme’s function file – or use

    Code Snippets

    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' ) . '&nbsp;' ;
    return $args ;
    }
    #210535

    Topic: Tag html

    in forum Themes
    Scordisian
    Participant

    Hello,

    I was wondering. The following <?php bbp_topic_tag_list(); ?>
    call the tags from what I can see. But where can I change the preceding class="bbp-topic-tags".

    I want to change the class name.

    Thnx.

    #210526
    Robin W
    Moderator
    add_shortcode (‘kiki-greet’ , ‘kiki_greet’ ) ;
    function kiki_greet() {
    $user = wp_get_current_user() ;
    echo '<div="kiki-greet">'.$user->display_name.'</div>' ;
    }

    try again

    #210525
    Kikis
    Participant

    I got an error why using the code

    #210521
    Robin W
    Moderator

    wrap it in some <div>‘s

    add_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)

    #210518
    Kikis
    Participant

    I’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

    #210515
    adamgby
    Participant

    Yes 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.

    #210511
    Robin W
    Moderator

    install

    bbp style pack

    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;
    }
    #210503
    Robin W
    Moderator

    so can you give us the code so far please

    #210496
    Robin W
    Moderator

    you 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>

    #210492
    Kikis
    Participant

    I got an error why using your shortcode

    #210488
    Robin W
    Moderator

    bbp topic count

    and use shortcode

    [display-top-users]

    #210485
    Chuckie
    Participant

    Thanks. Only mistake there is that you forgot to insert your corrected edit terms into the if statement. 🙂

    Thanks alot.

    #210481
    Robin W
    Moderator

    bbpress uses

    edit_topics and edit_replies so doesn’t use the capabilities above

    but 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 ;
    #210475
    Chuckie
    Participant

    I have this code:

    // check frontend user privileges
    $canEdit = is_user_logged_in() && (current_user_can('edit_posts') || current_user_can('edit_pages'));

    But I am not sure it is right. Front end users who are logged in can’t create or edit posts on my site but they can create an edit forum topics and replies.

    What is the correct syntax?

    #210468
    Robin W
    Moderator

    this

    Function reference

    suggests

    pll_register_string($name, $string, $group, $multiline);
    ‘$name’ => (required) name provided for sorting convenience (ex: ‘myplugin’)
    ‘$string’ => (required) the string to translate
    ‘$group’ => (optional) the group in which the string is registered, defaults to ‘polylang’
    ‘$multiline’ => (optional) if set to true, the translation text field will be multiline, defaults to false

    so maybe

    pll_register_string( 'slug_users', '_bbp_user_slug', 'polylang' );

    #210467
    Kenny Lajara
    Participant

    I tried changing the hook and nothing happened. This is my code now:

    /* Translate Users profile slug with Polylang */
    add_action( 'plugins_loaded','bbp_polylang_integration' );
    function bbp_polylang_integration() {
    	if ( function_exists( 'pll_register_string' ) ) {
    		pll_register_string( 'slug_users', '_bbp_user_slug', 'URL slugs' );
    	}
    } 

    About this:

    so is the context right – maybe ‘Polylang’ which seems to be the default?

    I don’t really understand what you mean.

    #210435
    Robin W
    Moderator

    but if you really want this box gone then,

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php

    transfer this to your pc and edit to remove

    <?php do_action( 'bbp_theme_before_topic_form_subscriptions' ); ?>
    
    						<p>
    							<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> />
    
    							<?php if ( bbp_is_topic_edit() && ( bbp_get_topic_author_id() !== bbp_get_current_user_id() ) ) : ?>
    
    								<label for="bbp_topic_subscription"><?php esc_html_e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
    
    							<?php else : ?>
    
    								<label for="bbp_topic_subscription"><?php esc_html_e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label>
    
    							<?php endif; ?>
    						</p>
    
    						<?php do_action( 'bbp_theme_after_topic_form_subscriptions' ); ?>

    and save

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-topic.php

    bbPress will now use this template instead of the original

    then repeat for form-reply.php removing

    <?php do_action( 'bbp_theme_before_reply_form_subscription' ); ?>
    
    						<p>
    
    							<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> />
    
    							<?php if ( bbp_is_reply_edit() && ( bbp_get_reply_author_id() !== bbp_get_current_user_id() ) ) : ?>
    
    								<label for="bbp_topic_subscription"><?php esc_html_e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
    
    							<?php else : ?>
    
    								<label for="bbp_topic_subscription"><?php esc_html_e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label>
    
    							<?php endif; ?>
    
    						</p>
    
    						<?php do_action( 'bbp_theme_after_reply_form_subscription' ); ?>
    #210432
    Chuckie
    Participant

    You create those pages. Each page has a short code it in. You then tell Theme My Login the links to each of those pages.

Viewing 25 results - 2,876 through 2,900 (of 32,517 total)
Skip to toolbar