Forums

Join
bbPress Support ForumsInstallationGo to last post in topic

Info

Tags

Go to last post in topic

  1. I'd like a link on each listed topic that takes you to the last post in the topic. Any help? :)

  2. <?php
    /*
    Plugin Name: Page &raquo;
    Description: Adds &raquo; to the end of topic titles, linking to latest post.
    Author: fel64
    Version: 0.7
    */
    
    if (!function_exists('is_tags')) {
    	function is_tags()
    	{
    		return is_tag();
    	}
    }
    
    if (is_front() || is_forum() || is_tags()) {
    	add_filter('topic_title', 'fel_addlatestlink', 101);
    }
    
    function fel_addlatestlink($title)
    {
    	global $topic;
    	$felgtlpl = get_topic_last_post_link($topic->topic_id);
    	$title = $title . ' <a href="' . $felgtlpl . '">&nbsp;&raquo;&nbsp;</a>';
    
    	return $title;
    }
    ?>

    That'll add a little double arrow to the name of each topic which goes to the latest. :)

  3. Thank you! I lost my password to the support forums in a computer crash but now I'm back to show my delayed gratitude :)

  4. How about a link to the second topic? So the first reply on a topic...

  5. I use this little plugin and my users love it. However, it stops working when using _ck_'s "Change Number of Front Page Topics" plugin.

    http://bbpress.org/forums/topic/how-to-restrict-number-of-latest-discussions-on-front-page

    Not sure which one is causing the problem, but thought it would be worth posting here, in case somebody wants to troubleshoot it.

  6. 0.9.0.1 has a link to the most recent post off the "freshness" column in the topic lists. See how that's done in Kakumei and adjust your template accordingly.

  7. My educated guess would be because it's grabbing the link within the title, the plugin that alters the page count is not getting unhooked yet.

    Try adding on a new line after global $topic;
    remove_action( 'bb_get_option_page_topics', 'bb_custom_topic_limit', 200);

    It's occurred to me there might be a bug in my plugin where I don't have that matching ,200 on the end of the same remove_action line. If I remember correctly, actions have to be unhooked with matching priority numbers to how they were added. So maybe try adding the ,200 also.

    Remember that bbPress's "topics per page" setting must be set to the actual number of posts you want listed on a topic page.

  8. You must log in to post.