| 1 | Installation |
|---|
| 2 | ~~~~~~~~~~~~ |
|---|
| 3 | |
|---|
| 4 | 1. Drop the file in wordpress/wp-content/plugins |
|---|
| 5 | 2. Activate the plugin the WordPress Plugin Management |
|---|
| 6 | 3. Write the following piece of code into your template (index.php) |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | <li id="recent_comments"><?php _e('Recent Comments:'); ?> |
|---|
| 10 | <ul> |
|---|
| 11 | <? get_recent_comments(); ?> |
|---|
| 12 | </ul> |
|---|
| 13 | </li> |
|---|
| 14 | |
|---|
| 15 | Done. If you want more, read on... |
|---|
| 16 | |
|---|
| 17 | Advanced configuration |
|---|
| 18 | ~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 19 | |
|---|
| 20 | 4. (Optional) |
|---|
| 21 | You can specify one to three arguments to the function. It is possible to |
|---|
| 22 | name only one argument or only two. Look at the following examples. |
|---|
| 23 | |
|---|
| 24 | The arguments have the following meaning: |
|---|
| 25 | 1. Number of comments to display. |
|---|
| 26 | 2. Maximum Number of characters in a comment excerpt |
|---|
| 27 | 3. Formatting |
|---|
| 28 | |
|---|
| 29 | If you don't specify arguments the plugin defaults to 5 comments, 120 |
|---|
| 30 | characters per comment and a standard formatting. |
|---|
| 31 | |
|---|
| 32 | The format is a piece of html code where you use tags that will be replaced |
|---|
| 33 | by the actual data: |
|---|
| 34 | |
|---|
| 35 | %comment_excerpt - Shortened comment. |
|---|
| 36 | %comment_link - Link to the comment. Something like: |
|---|
| 37 | http://blog.example.com/wp/archives/2005/02/03/this-is-a-test/#comment-523 |
|---|
| 38 | %comment_author - Name left by the commenter |
|---|
| 39 | %comment_date - Date of comment |
|---|
| 40 | %post_title - Title of the posting |
|---|
| 41 | %post_link - Link to the posting (and not the comment). Something like: |
|---|
| 42 | http://blog.example.com/wp/archives/2005/02/03/this-is-a-test/ |
|---|
| 43 | %post_date - Date of the posting |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | Examples |
|---|
| 47 | ~~~~~~~~ |
|---|
| 48 | |
|---|
| 49 | Show the 8 most recent comments |
|---|
| 50 | <?php get_recent_comments(8); ?> |
|---|
| 51 | |
|---|
| 52 | Show the 8 most recent comments, with a maximum of 100 characters per comment: |
|---|
| 53 | <?php get_recent_comments(8,100); ?> |
|---|
| 54 | |
|---|
| 55 | The same with your own formatting |
|---|
| 56 | <?php get_recent_comments(8,100,'<li><a href="%comment_link">%comment_author</a>: %comment_excerpt</li>'); |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | Feedback |
|---|
| 61 | ~~~~~~~~ |
|---|
| 62 | |
|---|
| 63 | krischan@jodies.de |
|---|
| 64 | http://blog.jodies.de |
|---|
| 65 | |
|---|