| User | Post |
|
12:58 am 19 Feb 2007
| Desi
Member
| | | |
|
| posts 44 |
|
|
As you know, I am running the Minimalist theme and it has a side bar that is displayed all the pages. The side bar includes a recent posts section. I would like to include a Recent Forum Post section that just says Who Posted the on what topic… So for instance: "Desi on Simple Forum is Great." The html for the normal recent post section is pasted in below. Don't suppose you could assist in changing this to pull up the right information from the sf portion of the database?
Thanks!
Desi
//–<?php
$today = current_time('mysql', 1);
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt AND post_type='post'< '$today' ORDER BY post_date DESC LIMIT 5")):
?>
//<h2><?php _e("Recent Posts"); ?></h2> //<div class="box"> //<ul>
//<?php
foreach ($recentposts as $post) {
if ($post->post_title == '')
$post->post_title = sprintf(__('Post #%s'), $post->ID);
echo "<li><a href='".get_permalink($post->ID)."'>";
the_title();
echo '</a></li>';
}
?>
//</ul>
|
|
|
1:13 am 19 Feb 2007
| Desi
Member
| | | |
|
| posts 44 |
|
|
Just downloaded 1.6 and saw the Recent Post tags. I'll mess with it and see if I can figure it out on my own. Thanks for this addition!
|
|
|
2:25 am 19 Feb 2007
| Desi
Member
| | | |
|
| posts 44 |
|
|
I like the new tags and have it working great. Just out of curiosity though, is there any way to make it work in the format I noted above. I would just like it to match the way recent comments are set up. And I noticed I included the wrong code above — the above code is for posts which do not note the author. Here is the current code for recent comments…
//<?php global $comment; if ( $comments = $wpdb->get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID FROM $wpdb->comments WHERE comment_approved='1' ORDER BY comment_date_gmt DESC LIMIT 5") ) : ?>
//<h2><?php _e('Recent Comments'); ?></h2> //<div class="box"> //<ul> //<?php foreach ($comments as $comment) { echo '<li>' . sprintf('%s <span style="text-transform: lowercase;">on</span><br />%s', get_comment_author(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . get_the_title($comment->comment_post_ID) . '</a>'); echo '</li>'; } ?>
Also, any way to just have it say the Topic name without the "Topic:" in front?
Thanks!
|
|
|
|
|
Save me hunting can you give me a link again so I can take a look at the output… then I'll come back to you on the rest?
Update: OK - I found it. More useful, actually to look at the theme original. This can ber coded very easily but not really through a standard template tag. I can knock up a bit of code for you that you can include in your sidebar and if anything useful comes out of that I can include it in the tags code for the future.
|
|
|
1:17 pm 19 Feb 2007
| Desi
Member
| | | |
|
| posts 44 |
|
|
|
|
|
I've sent you an email package to try out.
|
|
|
5:52 pm 19 Feb 2007
| Desi
Member
| | | |
|
| posts 44 |
|
|
Looks great. Thanks so much!
|
|
|
1:11 am 20 Feb 2007
| maxpouliot
Guest
| | | |
|
| |
|
|
I wnat to do this on my site also. What's the easiest way?
|
|
|
|
|
What, exactly, is it you are after?
|
|
|
1:43 am 20 Feb 2007
| maxpouliot
Guest
| | | |
|
| |
|
|
putting recent post on the sidebar
|
|
|
|
|
Well - using the supplied template tag as detailed in the guide. Is that what you mean?
|
|
|
3:48 pm 28 Feb 2007
| Rich
Guest
| | | |
|
| |
|
|
First off, I love this pugin!
I am also trying to put recent forum posts in my navigation. I have been sucessfull in getting the posts in the sidebar, but am having trouble formatting them. I sthsi possible?
here are 4 things I woud like to do:
1.Match the font size to the rest of the navigation items.
2. Match the link color to the rest of the site
3. Insert a line break before each value (ie before By:, on:, etc)
4. Make font size of user, forum, date smaller that topic.
here is a link to the current site http://governmentfutures-dev.com/talk
Thanks in advvnce.
|
|
|
|
|
Well I specifically didn't put classes in so that you can style the list from your themes stylesheet. It will pick up whatever list styles and paragraph styles you have in place for whatever area (i.e., div) that you place it. So that is where you have to look.
The line breaks you want would currently involve editing the tag code itself (in sf-tags.php). It will probaqbly be best if in the next release I try and add some more formatting options in the tag parameters. The problem, as usual, is that everyone wants it to look different! Which is why I just allowed it to pick up the current theme styles.
|
|