Info
- 4 posts
- 2 voices
- Started 8 months ago by ineken
- Latest reply from ineken
- This topic is not resolved
Last replies on sidebar with
-
- Posted 8 months ago #
Hello,
I am looking for a way to display in my sidebar the latest replies, not just the avatar and name of the topic like the widget, but the avatar, the user name and a link to his profile, the link and name of the topic and particularly an extract of his reply.
I really do not see how i can do this, could you help me?
A link to a tutorial, or other would be perfect
Thank you in advance. -
- Posted 8 months ago #
up?
-
- Posted 8 months ago #
Use the code in the bbp-core-widgets.php file as your guide. It is it's own tutorial.
-
- Posted 8 months ago #
thank you for help.
I found the right file, I found the good part, I think it was leave I should use.
function widget( $args, $instance ) {
extract( $args );
$title = apply_filters( 'bbp_replies_widget_title', $instance['title'] );
$max_shown = !empty( $instance['max_shown'] ) ? $instance['max_shown'] : '5';
$show_date = !empty( $instance['show_date'] ) ? 'on' : false;// Query defaults
$replies_query = array(
'post_status' => join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ),
'posts_per_page' => $max_shown,
'order' => 'DESC'
);// Set the query name
bbp_set_query_name( 'bbp_widget' );// Get replies and display them
if ( bbp_has_replies( $replies_query ) ) :echo $before_widget;
echo $before_title . $title . $after_title; ?>-
<?php
$author_link = bbp_get_reply_author_link( array( 'type' => 'both', 'size' => 14 ) );
$reply_link = '' . bbp_get_reply_topic_title() . '';/* translators: bbpress replies widget: 1: reply author, 2: reply link, 3: reply date, 4: reply time */
printf( _x( $show_date == 'on' ? '%1$s on %2$s, %3$s, %4$s' : '%1$s on %2$s', 'widgets', 'bbpress' ), $author_link, $reply_link, get_the_date(), get_the_time() );
?>
<?php while ( bbp_replies() ) : bbp_the_reply(); ?>
<?php endwhile; ?>
<?php echo $after_widget;
endif;
bbp_reset_query_name();
}I miss it more than learning how to change it: D
thank you I go little by little.
-
You must log in to post.