Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove "Reply To:" in freshness block for forum


  • Fredriks
    Participant

    @fredriks

    Hello,

    I have searched a lot and digged in the code on how to remove the “Reply To:” in the freshness block for forum. Take a look at this example: where you eg can se “Reply To: 80’s dresses”.

    So how, do I remove this?

Viewing 10 replies - 1 through 10 (of 10 total)

  • Fredriks
    Participant

    @fredriks

    Any clue on this? According to the theme developer “Reply To:” is some sort of core functionality. One solution I got was to change in the language file to “nothing” for the row associated with this.

    Although that didn’t work out, nothing happened.

    Somebody who can point me in the right direction?


    Xevo
    Participant

    @xevo

    You can change it in your bbpress theme.

    Line 29 of form-reply.php: <legend><?php printf( __( 'Reply To: %s', 'bbpress' ), bbp_get_topic_title() ); ?></legend>


    Fredriks
    Participant

    @fredriks

    Thanks for answer!

    I’m afraid that doesn’t work. Even tried removing the total line (29) to see if the whole “title” disappears, which it didn’t. Removed booth in my theme “/wp-content/themes/my-theme/bbpress/form-reply.php” and in the plugin /wp-content/plugins/bbpress/templates/default/bbpress/form-reply.php

    Is there something I’m doing wrong?


    FreeWPress
    Participant

    @freewpress

    Go in your css and find and add this display none!!

    #bbpress-forums fieldset.bbp-form legend {
        display: none;
    }

    Fredriks
    Participant

    @fredriks

    I’m afraid that doesn’t work either. I think it would look better if it could get removed in the source and not hidden with CSS.

    I asked the theme developer and he told me it is a core-function, nothing to do with the theme Im using. I have my developing site under the following URL http://dala.se/forum – where you could see the “Reply To”.

    I have tracked it down to the following files:
    /wp-content/plugins/bbpress/includes/topics/template.php
    Row: 1789-1806

    function bbp_topic_last_reply_title( $topic_id = 0 ) {
    	echo bbp_get_topic_last_reply_title( $topic_id );
    }
    	/**
    	 * Return the title of the last reply inside a topic
    	 *
    	 * @param int $topic_id Optional. Topic id
    	 * @uses bbp_get_topic_id() To get the topic id
    	 * @uses bbp_get_topic_last_reply_id() To get the topic last reply id
    	 * @uses bbp_get_reply_title() To get the reply title
    	 * @uses apply_filters() Calls 'bbp_get_topic_last_topic_title' with
    	 *                        the reply title and topic id
    	 * @return string Topic last reply title
    	 */
    	function bbp_get_topic_last_reply_title( $topic_id = 0 ) {
    		$topic_id = bbp_get_topic_id( $topic_id );
    		return apply_filters( 'bbp_get_topic_last_topic_title', bbp_get_reply_title( bbp_get_topic_last_reply_id( $topic_id ) ), $topic_id );
    	}
    

    /wp-content/plugins/bbpress/includes/replies/template.php
    Row: 471-491

    function bbp_reply_title( $reply_id = 0 ) {
    	echo bbp_get_reply_title( $reply_id );
    }
    
    	/**
    	 * Return the title of the reply
    	 *
    	 * @since bbPress (r2553)
    	 *
    	 * @param int $reply_id Optional. Reply id
    	 * @uses bbp_get_reply_id() To get the reply id
    	 * @uses get_the_title() To get the reply title
    	 * @uses apply_filters() Calls 'bbp_get_reply_title' with the title and
    	 *                        reply id
    	 * @return string Title of reply
    	 */
    	function bbp_get_reply_title( $reply_id = 0 ) {
    		$reply_id = bbp_get_reply_id( $reply_id );
    
    		return apply_filters( 'bbp_get_reply_title', get_the_title( $reply_id ), $reply_id );
    	}

    But tracking it further just lead me to a WP core file and function:
    /wp-includes/post-template.php
    Row: 102


    Fredriks
    Participant

    @fredriks

    Somebody who knows how to fix this?


    FreeWPress
    Participant

    @freewpress

    Hi, copy and paste here your loop-single-forum.php … i have solution for you!!


    Fredriks
    Participant

    @fredriks

    I have my loop-sinlge-forum.php in my child-theme and it looks like this:

    <?php
    
    /**
     * Forums Loop - Single Forum
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    ?>
    
    <ul id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>
    
    	<li class="bbp-forum-info">
    
    		<?php do_action( 'bbp_theme_before_forum_title' ); ?>
    
    	<div class="bbp-forum-header">
    		<a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>" title="<?php bbp_forum_title(); ?>"><?php bbp_forum_title(); ?></a>
    		<div class="bbp-forum-content"><?php the_content(); ?></div>
    	</div>
     
    
    		<?php do_action( 'bbp_theme_after_forum_title' ); ?>
    
    		<?php do_action( 'bbp_theme_before_forum_sub_forums' ); ?>
    
    		<?php 
    		
    		if (is_single()) {
    			
    			bbp_list_forums();
    			
    		} else {
    		
    		st_bbp_list_forums( array (
    		'before'            => '<ul class="bbp-forums-list">',
    		'after'             => '</ul>',
    		'link_before'       => '<li class="bbp-forum">',
    		'link_after'        => '</li>',
    		'count_before'      => '<div class="topic-reply-counts">Ämnen: ',
    		'count_after'       => '</div>',
    		'count_sep'         => '<br />Inlägg: ',
    		'separator'         => '<div style="clear:both;"></div>',
    		'forum_id'          => '',
    		'show_topic_count'  => true,
    		'show_reply_count'  => true,
    		'show_freshness_link' => true,
    		)); 
    		
    		}
    		?>
    
    		<?php do_action( 'bbp_theme_after_forum_sub_forums' ); ?>
    
    		<?php do_action( 'bbp_theme_before_forum_description' ); ?>
    
    		<?php do_action( 'bbp_theme_after_forum_description' ); ?>
    
    		<?php bbp_forum_row_actions(); ?>
    	</li>
    <?php if (is_single()) { ?>
    	<li class="bbp-forum-topic-count">
    		<?php _e('Topics: ','bbpress') ?><?php bbp_forum_topic_count(); ?><br />
            <?php _e('Posts: ','bbpress') ?><?php bbp_show_lead_topic() ? bbp_forum_reply_count() : bbp_forum_post_count(); ?>
    	</li>
    
    	<li class="bbp-forum-freshness">
    
    		<?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?>
    
    		<?php st_last_poster_block ( get_the_ID()  ) ?>
    
    		<?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>
    
    	</li>
    <?php } ?>
    </ul><!-- #bbp-forum-<?php bbp_forum_id(); ?> -->

    This because I had to hard code for swedish language on line 41 and 43, just this is changed, nothing more with the code.

    Thanks for taking your time!


    FreeWPress
    Participant

    @freewpress

    <?php st_last_poster_block ( get_the_ID() ) ?>

    This function not exist in bbpress, it’s home made? you must to search in your functions lists..

    We must to open this function to change a little parameter to remove reply to….


    NateLSpence
    Participant

    @natelspence

    I solved this (and a whole host of other customization problems) by replacing the bbp_forum_freshness_link() function call in loop-single-forum.php with my own function, which I copied from bbp_get_forum_freshness_link() and then edited.

    In there, I changed a call from bbp_get_forum_last_reply_title() to bbp_get_forum_last_topic_title(), since the only difference I could see between the two was that bbp_get_forum_last_reply_title() adds the cluttered “Reply To: ” to the string.

    You can probably achieve this with filters, as well.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Skip to toolbar