Skip to:
Content
Pages
Categories
Search
Top
Bottom

Displaying a small snippet of the most recent post

  • @clicknathan

    Participant

    Would anyone perhaps know how I might display a small snippet of the most recent post in a forum under that forum’s title on the front page? So, my front page might look like:

    My Forum

    Here is a bit of text from the most recent post in this forum

    Another of my Forums

    And here is some text from this forum’s most recent post

    Etc, etc.

Viewing 4 replies - 1 through 4 (of 4 total)
  • @chrishajer

    Participant

    @clicknathan

    Participant

    That’s a great start, Chris – however it basically drops an entire list of recents with excerpts, and I was hoping to have the excerpt for each group listed after that group.

    I’m quite the novice when it comes to PHP, but perhaps I can figure out how to mod this.

    @clicknathan

    Participant

    So here’s what I found, though I wasn’t personally able to get it to work myself, I’m almost positive that someone with a bit more PHP knowledge would have been able to:

    This plugin: https://bbpress.org/plugins/topic/forum-last-poster/#post-1538

    + _ck_’s advice in this post: https://bbpress.org/plugins/topic/forum-last-poster/#post-1546

    He details how, using substr, you can truncate the amount of words being pulled from the any piece of content. Theoretically you could use:

    post_text(forum_last_topic_id());

    But with the truncation method he mentions. I, unfortunately, just don’t know how. :(

    @chrishajer

    Participant

    Now that you mention it, I think search returns just a snippet of results, not the full post. Maybe look at how that’s done?

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