Info
- 5 posts
- 2 voices
- Started 2 years ago by DKB
- Latest reply from Adam Harley
- This topic is not resolved
Directly to latest post of Topic
-
- Posted 2 years ago #
Hi, is there a way to make a link for the latest post on the forum homepage, so a vistor can go directly to that instead of navigation through the pages.
I am using bbPress 1.0.2
Thanks in advance.
-
- Posted 2 years ago #
<?php $last_post = bb_get_last_post(); ?><a href="<?php echo get_post_link($last_post->post_id); ?>">Latest post</a><?php unset($last_post); ?>Put that in your
front-page.phpin the parts you want the latest post link to appear. Try after<?php topic_page_links(); ?> -
- Posted 2 years ago #
Slightly lighter version
<a href="<?php post_link($topic->topic_last_post_id); ?>">Latest</a> -
- Posted 2 years ago #
It works but i get it on the wrong row.
Here is the code:
<?php if ( $topics ) : foreach ( $topics as $topic ) : ?> <tr<?php topic_class(); ?>> <td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a><?php topic_page_links(); ?></td> <td class="num"><?php topic_posts(); ?></td> <!-- <td class="num"><?php bb_topic_voices(); ?></td> --> <td class="num"><?php topic_last_poster(); ?></td> <td class="num"><a href="<?php topic_last_post_link(); ?>"><?php topic_time(); ?></a></td>how can i get it after the topic pages and can i add i image instead of latest?
-
- Posted 2 years ago #
<?php if ( $topics ) : foreach ( $topics as $topic ) : ?> <tr<?php topic_class(); ?>> <td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a><?php topic_page_links(); ?> <a href="<?php post_link($topic->topic_last_post_id); ?>">Latest</a></td> <td class="num"><?php topic_posts(); ?></td> <!-- <td class="num"><?php bb_topic_voices(); ?></td> --> <td class="num"><?php topic_last_poster(); ?></td> <td class="num"><a href="<?php topic_last_post_link(); ?>"><?php topic_time(); ?></a></td>Just change the word Latest to whatever you like :)
-
You must log in to post.