Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'the_excerpt'

Viewing 23 results - 1 through 23 (of 23 total)
  • Author
    Search Results
  • #146543

    Yukon Cornelius
    Participant

    update: this was undesirable because the link to the reply was going to the reply itself, which is just a single post of the ‘reply’ custom post type. I have created this dodgy hack of the above code so the permalink for the replies is still the topic permalink. I’m sure there are a million better ways to do this, but it does the job for me so i thought i’d share the updated version.

    function jag_add_last_reply() { { 
     $jag_last_reply_id = bbp_get_forum_last_reply_id();
     $jag_last_topic_id = bbp_get_forum_last_topic_id();
    
    $new_args = array(
        'post_type'=> 'reply',
        'p' => $jag_last_reply_id
    );
    $post_title_args = array(
        'post_type'=> 'topic',
        'p' => $jag_last_topic_id
    );
    $other_args = array(
        'post_type'=> 'topic',
        'p' => $jag_last_topic_id
    );
    $jag_query = new WP_Query( $post_title_args );
    $nest_query = new WP_Query( $new_args );
    $another_nest_query = new WP_Query( $other_args );
    
       if ( $jag_query->have_posts() ) : while ( $jag_query->have_posts() ) : $jag_query->the_post();
         $this_post_id=$post->ID;
         $this_post_permalink= get_permalink(); ?>   
                                 
         <a href="<?php echo $this_post_permalink; ?>">
    
    <?php endwhile; 
       endif; wp_reset_query();
    
       if ( $nest_query->have_posts() ) : while ( $nest_query->have_posts() ) : $nest_query->the_post();
         $this_post_id=$post->ID;
         $this_post_title= get_the_title();
         $this_post_content= get_the_excerpt(); ?>
                                 
         <h1><?php echo $this_post_title; ?></h1></a>
         <div class="the_content"><?php echo $this_post_content; ?></div>
                         
       <?php endwhile;
    elseif ( $another_nest_query->have_posts() ) : while ( $another_nest_query->have_posts() ) : $another_nest_query->the_post();
         $this_post_id=$post->ID;
         $this_post_title= get_the_title();
         $this_post_content= get_the_excerpt(); ?>   
                                 
         <h1><?php echo $this_post_title; ?></h1></a>
         <div class="the_content"><?php echo $this_post_content; ?></div>
                         
       <?php endwhile; 
       endif; 
        }} 
    // Hook into action
    add_action('bbp_theme_after_forum_description','jag_add_last_reply');

    Yukon Cornelius
    Participant

    I spent so long trawling google for an answer to this question, so i am sharing what i came up with. It might not be beautiful code (i patched it together from a number of sources), but it works for me.

    Basically, i have a list of forums on my forum home page. I just wanted to show the latest post within each forum as a teaser below the forum description – not just the title, but the excerpt, too. I can’t believe there’s nothing out there explaining how to do this. It seems like a pretty obvious format for the forum index.

    The following snippet will output the latest reply, with post title and post link below the forum description. If there are no replies, it will output the latest topic instead.

    function jag_add_last_reply() { { 
     $jag_last_reply_id = bbp_get_forum_last_reply_id();
     $jag_last_topic_id = bbp_get_forum_last_topic_id();
    $new_args = array(
        'post_type'=> 'reply',
        'p' => $jag_last_reply_id
    );
    $other_args = array(
        'post_type'=> 'topic',
        'p' => $jag_last_topic_id
    );
     
    $nest_query = new WP_Query( $new_args );
    $another_nest_query = new WP_Query( $other_args );
     
       if ( $nest_query->have_posts() ) : while ( $nest_query->have_posts() ) : $nest_query->the_post();
         $this_post_id=$post->ID;
         $this_post_title= get_the_title();
         $this_post_content= get_the_excerpt();
         $this_post_permalink= get_permalink(); ?>   
                                 
         <a href="<?php echo $this_post_permalink; ?>"><h1><?php echo $this_post_title; ?></h1></a>
         <div class="the_content"><?php echo $this_post_content; ?></div>
                         
       <?php endwhile;
    elseif ( $another_nest_query->have_posts() ) : while ( $another_nest_query->have_posts() ) : $another_nest_query->the_post();
         $this_post_id=$post->ID;
         $this_post_title= get_the_title();
         $this_post_content= get_the_content();
         $this_post_permalink= get_permalink(); ?>   
                                 
         <a href="<?php echo $this_post_permalink; ?>"><h1><?php echo $this_post_title; ?></h1></a>
         <div class="the_content"><?php echo $this_post_content; ?></div>
                         
       <?php endwhile; 
       endif; 
        }} 
    // Hook into action
    add_action('bbp_theme_after_forum_description','jag_add_last_reply');

    Just put this in your theme’s functions.php and it should do the trick. Haven’t figured out how to spit out multiple posts and replies for each forum yet, but this is all i needed. Good luck.

    #144999

    Stephen Edgar
    Moderator

    If when you decide to come back to this you’ll want to use the_excerpt

    http://codex.wordpress.org/Function_Reference/the_excerpt

    There are varios examples scattered throught this site also

    http://bbpress.org/forums/search/the_excerpt/

    #137952

    Stephen Edgar
    Moderator

    You won’t need this text and/or value that you imported.

    You will have to create your own templates by copying bbPress templates to your theme directory:

    http://codex.bbpress.org/theme-compatibility/

    You would then use the_excerpt rather than the_content to output only ‘x’ words from each topic/reply

    http://codex.wordpress.org/Function_Reference/the_excerpt

    There are a few people who have played around using the_excerpt and bbPress, have a good look around the site to see how and what they did:

    http://bbpress.org/forums/search/the_excerpt/

    #137882

    Stephen Edgar
    Moderator

    I have a follow up question on the above topic. In the old BB we had each topic showed with a short summary field of the post content (usually just the first X characters of the content). Is there a way to do that with bbPress Forum topics? I do not see any existing widget that does this. In fact, is there even a field mapping for such a thing?

    In WordPress terms this is known as ‘the_excerpt’ and is a function that will only show ‘x’ words of a post, this is not something you can transfer, it is a ‘display’ function in WordPress.

    Oops, forgot another item. I want to bring in topic tags as well. How do I do that.

    These are a little tricky mainly because understanding how they are implemented in WordPress is not an easy task as they are distributed throughout three tables.

    Upload a csv file to http://gist.github.com or http://pastebin.com with a couple of examples of how your data currently has ‘tags’ associated to the topics and I will try to come up with something that is a little clearer than mud for you ;)

    #135361

    SquarePenguin
    Participant

    Hello,

    Could anyone point me in the right direction so I can identify the filters used in bbpress so that I might remove wptexturize?

    I have identified those required for WordPress itself, but bbpress appears to use different filters. The WordPress ones I successfully used are:

    remove_filter( ‘the_title’, ‘wptexturize’ );
    remove_filter( ‘the_content’, ‘wptexturize’ );
    remove_filter( ‘the_excerpt’, ‘wptexturize’ );
    remove_filter( ‘comment_text’, ‘wptexturize’ );

    Which I added to functions.php of a child theme.

    I then identified what I thought were the required filters in bbpress from here:

    http://etivite.com/api-hooks/bbpress/trigger/apply_filters/bbp_get_topic_content/

    …and added the following to functions.php to no effect:

    remove_filter( ‘bbp_get_reply_content’, ‘wptexturize’);
    remove_filter( ‘bbp_get_topic_content’, ‘wptexturize’);

    These filters do not work, so I assume they are not the correct ones. Any ideas what the correct filters are?

    Thank you!


    Heavenlyz
    Participant

    Wordpress version: 3.5.1
    bbPress version: 2.3
    site: http://www.heavenlyz.com

    Apologies if this is considered cross-posting, as this appears as a reply to another thread (but that other thread title isn’t similar). The other thread is… http://bbpress.org/forums/topic/non-functional-index-page-when-bbpress-2-1rc4-is-used-with-woothemes-canvas-5-05/#post-133638

    Ok, so newbie here who knows html and understands coding but is really keen to not screw up the site that someone else has built for me (so apologies if the answer is above and I’m not seeing it).

    The site is http://www.heavenlyz.com and, I think, I’m using the “Nollie” theme.

    I’ve installed bbpress, created a couple of forums and – via the great info on this thread – created a page called “Boardroom”, into which I’ve inserted the “[bbp-forum-index]” shortcode. Hey presto, after much head scratching, I can now see a forum index on http://www.heavenlyz.com/boardroom/…woohoo

    But, my next challenge is to be able to open one of the forums shown. Am struggling with this.

    Having searched, the most relevant answer seems to be… http://bbpress.org/forums/topic/non-functional-index-page-when-bbpress-2-1rc4-is-used-with-woothemes-canvas-5-05/#post-133638

    If you think there is a better (read “easier” :) solution, then please suggest but if not, please read on…

    Because I am using the Nollie theme – I think – the parent/ child argument in that thread doesn’t apply, so am looking at changing the root page.php only (to be honest, I wouldn’t know how to work out whether the child page exists/ how to find the child page).

    In the thread linked to above, Lab says

    Next, change the entry div as shown, to modify the current conditional check to ALSO see if you are on a bbPress page. Without this extra bit, it assumes that you want the page to show the_excerpt() on every page other than single.php …. not true. We want full content on bbPress pages as well

    But my page.php says…

    ID, ‘mfn-post-layout’, true) ) {
    case ‘left-sidebar’:
    $class = ‘ with_aside aside_left’;
    break;
    case ‘right-sidebar’:
    $class = ‘ with_aside aside_right’;
    break;
    default:
    $class = ”;
    break;
    }
    ?>

    Where’s the “entry div”? Apologies if this is a laughably stupid question.

    All help appreciated. N.b. As I’m learning, to start with, I’d rather keep the changes simple and effective rather than complex and golden.


    Heavenlyz
    Participant

    Ok, so newbie here who knows html and understands coding but is really keen to not screw up the site that someone else has built for me (so apologies if the answer is above and I’m not seeing it).

    The site is http://www.heavenlyz.com and, I think, I’m using the “Nollie” theme.

    I’ve installed bbpress, created a couple of forums and – via the great info on this thread – created a page called “Boardroom”, into which I’ve inserted the “[bbp-forum-index]” shortcode. Hey presto, after much head scratching, I can now see a forum index on http://www.heavenlyz.com/boardroom/…woohoo :)

    But, my next challenge is to be able to open one of the forums shown. Am struggling with this.

    Because I am using the Nollie theme – I think – the parent/ child argument doesn’t apply, so am looking at changing the root page.php

    Above, Lab says

    Next, change the entry div as shown, to modify the current conditional check to ALSO see if you are on a bbPress page. Without this extra bit, it assumes that you want the page to show the_excerpt() on every page other than single.php …. not true. We want full content on bbPress pages as well

    But my page.php says…

    ID, ‘mfn-post-layout’, true) ) {
    case ‘left-sidebar’:
    $class = ‘ with_aside aside_left’;
    break;
    case ‘right-sidebar’:
    $class = ‘ with_aside aside_right’;
    break;
    default:
    $class = ”;
    break;
    }
    ?>


    <div id="Content" class="subpage”>


    <?php
    if( $class ) echo '’;

    while ( have_posts() )
    {
    the_post();
    get_template_part( ‘includes/content’, ‘page’ );
    }

    if( $class ) echo ”;
    ?>

    Where’s the “entry div”? Apologies if this is a laughably stupid question.

    All help appreciated. N.b. As I’m learning, to start with, I’d rather keep the changes simple and effective rather than complex and golden.

    #133346

    Sami Keijonen
    Participant

    There should be `the_excerpt()` or `the_content()` doesn’t return anything.

    #130916

    eklay
    Participant

    I’ve found the offending filter: ‘bbp_replace_the_content’

    The function bbp_replace_the_content() hijacks the content of any post, regardless of which loop it is in, based simply on whether the page is also the forum archive or topic archive page.

    I was able to get the excerpt for my custom loop, while still preserving the Forum archive on the same page, by using remove_filter( ‘the_content’, ‘bbp_replace_the_content’ ) before the_excerpt() and add_filter( ‘the_content’, ‘bbp_replace_the_content’ ) after.

    #130915

    eklay
    Participant

    @johnnypea – Did you ever get this figured out? Using the_excerpt() anywhere on a BBPress page returns Forum content, even when called within a non-forum custom loop, and then completely clears the $post object… This is very frustrating.

    #121409

    LabSecrets
    Participant

    You have several issues going on here, but they are directly related to your theme. As is very common, it appears to me that your theme has a conditional statement in the template file that builds archive pages. As such, it’s treating the content for bbPress forums as excerpts, as well as applying some unwanted styling.

    Have you tried to build a page using the shortcode method? If so, what was the result? If you found it worked properly, then the issue as suggested above, and you could try to modify your theme or child-theme files to add a similar conditional that looks for bbPress and forces it to use the_content() instead of the_excerpt(). See: http://bbpress.org/forums/topic/non-functional-index-page-when-bbpress-2-1rc4-is-used-with-woothemes-canvas-5-05/

    If this page is being built with shortcodes (I don’t think it is from what I see) then what is the result if you try the default forum index method? We outline both methods in our step by step video here: http://labzip.com/the-definitive-guide-to-buddypress-bbpress-configuration/

    We’ll get you there… ;-)

     

     


    LabSecrets
    Participant

    Hi Gang,

    well…. this one through me for a loop today as well, when moving our WooThemes Canvas for bbPress & BuddyPress site for a test drive on bbPress 2.2 ( http://labsecrets.com/demo/canvas-commerce )

    The individual forums would work fine, but the main forum index was rendering what looked like a post excerpt, with everything jumbled into a single paragraph.

    Solution was actually rather simple. If you are using a child-theme in Canvas (you ARE using a child-theme I hope?? ;-)  ) simply make a copy of the content-page.php file from parent, and put it into your child-theme folder.

    Next, change the entry div as shown, to modify the current conditional check to ALSO see if you are on a bbPress page. Without this extra bit, it assumes that you want the page to show the_excerpt() on every page other than single.php …. not true. We want full content on bbPress pages as well ;-)

    <div class="entry">
    <?php
    /* If this is a bbPress page show full content not exerpt */
    if ( ! is_singular() && (! is_bbPress()) ) {
    the_excerpt();
    } else {
    the_content(__('Continue Reading &rarr;', 'woothemes') );
    }
    wp_link_pages( $page_link_args );
    ?>
    </div><!-- /.entry -->

    With this simple mod, all is well and now the native forums index works, and so does building a custom page with shortcode. Ta da!

    See: http://labsecrets.com/demo/canvas-commerce/forums/

    #111194

    In reply to: Theme malfunction


    Tammy Hart
    Member

    I figured it out. It had something do with me calling the_excerpt_rss in my header.php. removed it, works perfectly!

    #41130

    aravoth2011
    Participant

    Hi everyone. I’ve been trying to display posts from the forum on a static home page so that it gives the appearance of a blog. Basically, I’m using the tewntyeleven theme and I’m using the showcase.php template to display the forum entries.

    you can see what I’m going for here.. http://test.objectsinmotion.org

    So far, I’ve managed to modify it so that super stickies are put in the featured slideshow. The forum posts are displayed properly, and I’ve managed to pull the topic tags. One of the things I’ve been having a lot of trouble with is displaying the forum a topic is posted in as a category. Normally there is a line of text below the topic excerpt that says, “posted in (category name)” . But it seems that nothing I have tried so far is working. In fact, whenever I try to call the forum title, is displays the topic title instead.

    I’m not a programmer, and I know next to nothing about php, I’ve been doing a lot of reading, and trying to learn as much as I can, but I’m just running into a brick wall here. Any help anyone could offer would be much appreciated.

    Showcase.php uses content.php to display all that meta data. right now it looks like this..

    <?php
    /**
    * The default template for displaying content
    *
    * @package WordPress
    * @subpackage Twenty_Eleven
    * @since Twenty Eleven 1.0
    */
    ?>

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <header class="entry-header">
    <?php if ( is_sticky() ) : ?>
    <hgroup>
    <h2 class="entry-title"><a>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    <h3 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h3>
    </hgroup>
    <?php else : ?>
    <h1 class="entry-title"><a>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    <?php endif; ?>

    <?php if ( 'topic' == get_post_type() ) : ?>
    <div class="entry-meta">
    <?php twentyeleven_posted_on(); ?>
    </div><!-- .entry-meta -->
    <?php endif; ?>

    <?php if ( comments_open() && ! post_password_required() ) : ?>
    <div class="comments-link">
    <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
    </div>
    <?php endif; ?>
    </header><!-- .entry-header -->

    <?php if ( is_search() ) : // Only display Excerpts for Search ?>
    <div class="entry-summary">
    <?php the_excerpt(); ?>
    </div><!-- .entry-summary -->
    <?php else : ?>
    <div class="entry-content">
    <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?>
    <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
    </div><!-- .entry-content -->
    <?php endif; ?>

    <footer class="entry-meta">
    <?php $show_sep = false; ?>
    <?php if ( 'topic' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
    <?php
    /* translators: used between list items, there is a space after the comma */
    $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
    if ( $categories_list ):
    ?>
    <span class="cat-links">
    <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
    $show_sep = true; ?>
    </span>
    <?php endif; // End if categories ?>
    <?php
    /* translators: used between list items, there is a space after the comma */
    $topic_tags = bbp_get_topic_tag_list( '', __( ', ', 'twentyeleven' ) );
    if ( $topic_tags ):
    if ( $show_sep ) : ?>
    <span class="sep"> | </span>
    <?php endif; // End if $show_sep ?>
    <span class="tag-links">
    <?php printf( __( '<span class="%1$s">Tagged</span> %2$s ', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $topic_tags );
    $show_sep = true; ?>
    </span>
    <?php endif; // End if $topic_tags ?>
    <?php endif; // End if 'topic' == get_post_type() ?>

    <?php if ( comments_open() ) : ?>
    <?php if ( $show_sep ) : ?>
    <span class="sep"> | </span>
    <?php endif; // End if $show_sep ?>
    <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
    <?php endif; // End if comments_open() ?>

    </footer><!-- #entry-meta -->
    </article><!-- #post-<?php the_ID(); ?> -->

    Other things on my to-do list include making the comments section show number of forum replies instead of number of wordpress comments, and changing the author link so that it goes to the bbpress profile of that user instead of a wordpress post archive.

    For now though, I’m hoping that someone out there can help me with the “category” issue. Anyone have any ideas?

    #40795

    Mr. Salas
    Member

    Hello,

    i used wp 3.2.1 and a theme called wp-basis,

    but after installing bbpress no Forum content is visible.

    There is some generated forum-text in the header of the site

    “<meta name=”description” content=”Topic: DISKUSSION ZUM FILM …etc”

    below is the code of my header.php

    “<meta name=”description” content=”<?php if ( is_single() ) { wp_title(‘-’, true, ‘right’); echo strip_tags( get_the_excerpt() ); } elseif ( is_page() ) { wp_title(‘-’, true, ‘right’); echo strip_tags( get_the_excerpt() ); } else { bloginfo(‘description’); } ?>” />”

    i hope somebody can help.

    thx and kind regards

    Daniel

    #110232

    shooo
    Member

    Hello,

    thank you board, I tried, but it doesn’t work.

    I copied this code in my page function.php of my theme. but no widget is created.

    /**
    * bbPress Replies Widget
    *
    * Adds a widget which displays the replies list
    *
    * @since bbPress (r2653)
    *
    * @uses WP_Widget
    */
    class BBP_Replies_Widget2 extends WP_Widget {

    /**
    * Register the widget
    *
    * @since bbPress (r3389)
    *
    * @uses register_widget()
    */
    function register_widget() {
    register_widget( 'BBP_Replies_Widget2' );
    }

    /**
    * bbPress Replies Widget
    *
    * Registers the replies widget
    *
    * @since bbPress (r2653)
    *
    * @uses apply_filters() Calls 'bbp_replies_widget_options' with the
    * widget options
    */
    function BBP_Replies_Widget2() {
    $widget_ops = apply_filters( 'bbp_replies_widget_options', array(
    'classname' => 'widget_display_replies',
    'description' => __( 'balbalbalbalbalbalba.', 'bbpress' )
    ) );

    parent::WP_Widget( false, 'bbPress Reply List 2', $widget_ops );
    }

    /**
    * Displays the output, the replies list
    *
    * @since bbPress (r2653)
    *
    * @param mixed $args
    * @param array $instance
    * @uses apply_filters() Calls 'bbp_reply_widget_title' with the title
    * @uses bbp_set_query_name() To set the query name to 'bbp_widget'
    * @uses bbp_reset_query_name() To reset the query name
    * @uses bbp_has_replies() The main reply loop
    * @uses bbp_replies() To check whether there are more replies available
    * in the loop
    * @uses bbp_the_reply() Loads up the current reply in the loop
    * @uses bbp_get_reply_author_link() To get the reply author link
    * @uses bbp_get_reply_author() To get the reply author name
    * @uses bbp_get_reply_id() To get the reply id
    * @uses bbp_get_reply_url() To get the reply url
    * @uses bbp_get_reply_excerpt() To get the reply excerpt
    * @uses bbp_get_reply_topic_title() To get the reply topic title
    * @uses get_the_date() To get the date of the reply
    * @uses get_the_time() To get the time of the reply
    */
    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; ?>

    <div id="lastreply">

    <?php while ( bbp_replies() ) : bbp_the_reply(); ?>

    <div class="post">
    <h4>

    <?php
    $author_link = bbp_get_reply_author_link( array( 'type' => 'both', 'size' => 80 ) );
    $reply_link = '<a href="' . esc_url( bbp_get_reply_url() ) . '" title="' . bbp_get_reply_excerpt( bbp_get_reply_id(), 50 ) . '">' . bbp_get_reply_topic_title() . '</a>';

    /* 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() );
    ?>

    </h4>
    <?php the_excerpt(); ?>
    <div class="clearfix"></div>
    </div><!-- fin de post -->

    <?php endwhile; ?>

    </div><!-- fin du last reply-->

    <?php echo $after_widget;

    endif;

    bbp_reset_query_name();
    }

    /**
    * Update the forum widget options
    *
    * @since bbPress (r2653)
    *
    * @param array $new_instance The new instance options
    * @param array $old_instance The old instance options
    */
    function update( $new_instance, $old_instance ) {
    $instance = $old_instance;
    $instance['title'] = strip_tags( $new_instance['title'] );
    $instance['max_shown'] = strip_tags( $new_instance['max_shown'] );
    $instance['show_date'] = strip_tags( $new_instance['show_date'] );

    return $instance;
    }

    /**
    * Output the reply widget options form
    *
    * @since bbPress (r2653)
    *
    * @param $instance Instance
    * @uses BBP_Replies_Widget::get_field_id() To output the field id
    * @uses BBP_Replies_Widget::get_field_name() To output the field name
    */
    function form( $instance ) {
    $title = !empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
    $max_shown = !empty( $instance['max_shown'] ) ? esc_attr( $instance['max_shown'] ) : '';
    $show_date = !empty( $instance['show_date'] ) ? esc_attr( $instance['show_date'] ) : ''; ?>

    <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'bbpress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
    <p><label for="<?php echo $this->get_field_id( 'max_shown' ); ?>"><?php _e( 'Maximum replies to show:', 'bbpress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_shown' ); ?>" name="<?php echo $this->get_field_name( 'max_shown' ); ?>" type="text" value="<?php echo $max_shown; ?>" /></label></p>
    <p><label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Show post date:', 'bbpress' ); ?> <input type="checkbox" id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" <?php checked( 'on', $show_date ); ?> /></label></p>

    <?php
    }
    }

    sorry, I feel as bad as otter. :’(

    #110230

    shooo
    Member

    oO last replies are on ligne 749 no?

    but thank you, i change ligne 750

    <div id="lastreply">

    <?php while ( bbp_replies() ) : bbp_the_reply(); ?>

    <div class="post">
    <h4>

    <?php
    $author_link = bbp_get_reply_author_link( array( 'type' => 'both', 'size' => 60 ) );
    $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() );
    ?>

    </h4>
    <?php the_excerpt(); ?>

    </div><!-- fin de post -->

    <?php endwhile; ?>

    </div><!-- fin du last reply-->

    and it’s ok :) but I am afraid that the next bbpress update overwrites the change

    thx a lot for your help :)

    #40579

    shooo
    Member

    hello,

    I try desperately to create some kind of widget for my blog with last forum entries .

    I think query_posts was indicated because it is simple and effective.

    here is the code I use to fully control the design of my widget.

    <div id=”lastreply”>

    <?php

    query_posts(“post_type=reply”);

    while (have_posts()) : the_post();

    ?>

    <div class=”post”>

    <div class=”thumb”><?php echo get_avatar( get_the_author_id() , 60 ); ?></div>

    <h4>” rel=”bookmark”><?php the_title(); ?></h4>

    <small>De <?php the_author_posts_link(); ?> <span class=”red”>♥</span> <span class=”tag”><?php the_tags(‘#’,’, #’); ?></span></small>

    <?php the_excerpt(); ?>

    </div><!– fin de post –>

    <?php endwhile; ?>

    </div><!– last reply–>

    I have 3 problems so that my poor php skills prevents me to solve.

    1 / the title is not good, it starts with “reply to” it would have been clearer to the title of the topic directly.

    2 / the link isn’t the link to topic but the link for the answer!

    3 / but it’s going to be warmer, I wish to join the last replies to the last comment into a single widget, except that query_posts doesn’t work with the comments ^ ^

    would you have a little time to devote to my request? Thank you in advance.

    #40023

    JohnnyPea
    Member

    When I load the sidebar with the_content(), the_excerpt() or similar content function in custom loop before the main loop on page the forums (their contents) are displayed through that function in the sidebar.

    So I can’t use these content function before the main loop on page template? It seems to me bbPress is hooking the first function of this kind (the_content(), the_excerpt()…) on a page.

    I suppose bbPress plugin should avoid this to prevent malfunction in some themes.

    #107808

    Jared Atchison
    Moderator

    Genesis has 2 functions that I have determined are causing the problems.

    http://pastie.org/2469242 (/genesis/lib/structure/post.php lines 101-143 (as of 1.7.1))

    The first function is the post image function. Users have the ability to automatically set image thumbnails to appear on the archive listings. However if they turn this on, when you go to a bbPress archive page a random image from the media library ends up on the top of the page. This is turned of by default in Genesis, but is widely used.

    The second function is how Genesis displays post content. You can see, depending on how the user has Genesis configured, it uses the_excerpt or the_content_limit – which results in a dead loop.

    The other things I did such as remove the post info/meta, breadcrumbs, etc are just purely cosmetic. They aren’t *needed* per say, but it can look screwy if they are outputted on some of the forum pages.

    As long as Genesis is forced to always use the_content and the post image option is nuked, everything should always work smoothly.

    If you want to explore the option of a core patch I’d be more than happy to help you with a patch and testing :)

    #37639

    alexchenco
    Member

    I recently started using this WordPress PHP implementation of the Markdown http://michelf.com/projects/php-markdown/

    Right now it only supports Posts and Comments. Topics and Replies don’t get aprsed.

    This comes from markdown.php:

    # Post content and excerpts
    # - Remove WordPress paragraph generator.
    # - Run Markdown on excerpt, then remove all tags.
    # - Add paragraph tag around the excerpt, but remove it for the excerpt rss.
    if (MARKDOWN_WP_POSTS) {
    remove_filter('the_content', 'wpautop');
    remove_filter('the_content_rss', 'wpautop');
    remove_filter('the_excerpt', 'wpautop');
    add_filter('the_content', 'Markdown', 6);
    add_filter('the_content_rss', 'Markdown', 6);
    add_filter('get_the_excerpt', 'Markdown', 6);
    add_filter('get_the_excerpt', 'trim', 7);
    add_filter('the_excerpt', 'mdwp_add_p');
    add_filter('the_excerpt_rss', 'mdwp_strip_p');

    remove_filter('content_save_pre', 'balanceTags', 50);
    remove_filter('excerpt_save_pre', 'balanceTags', 50);
    add_filter('the_content', 'balanceTags', 50);
    add_filter('get_the_excerpt', 'balanceTags', 9);
    }

    How to modify the line above to be effective for Topics and Replies?


    alexchenco
    Member

    I would like to know how to start a custom bbPress loop to display the recent 5 posts of a certain forum (say Forum Test 1).

    In WordPress I create custom loops like this:

    `<?php $custom_posts = new WP_Query(); ?>

    <?php $custom_posts->query(‘post_type=bbp_topic&posts_per_page=5′); ?>

    <?php while ($custom_posts->have_posts()) : $custom_posts->the_post(); ?>

    <div class=”block-2 border-top”>

    <h2><a href=”<?php the_permalink(); ?>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘twentyten’ ), the_title_attribute( ‘echo=0′ ) ); ?>” rel=”bookmark”><?php the_title(); ?></a></h2>

    <?php the_excerpt(); ?>

    <p><?php comments_number(’0 Replies’,’1 Reply’,’% Replies’); ?>.</p>

    </div>

    <?php endwhile; ?>`

    How to do what I mentioned above in bbPress 1.1?

Viewing 23 results - 1 through 23 (of 23 total)