• Resolved cousinagam

    (@cousinagam)


    My blog posts are family stories and new ones don’t come in that often. I have a sidebar link to show all the stories, to show a list of people who’ve told stories, and to show people who appear in the stories. (Creating those pages is the height of my WordPress skill so far…)

    I’d like to include (on the main page or in the sidebar) a list of links to (say) the five most recent comments, somewhat like I see on the admin page. Any (reasonably specific) suggestions or avenues I should pursue?

    Site is http://www.cousinagamfhein.net

Viewing 15 replies - 1 through 15 (of 20 total)
  • http://codex.wordpress.org/Plugins/Comments

    Look there for ‘recent’ and ‘latest’ comments plugins.

    the codex is your friend

    Thread Starter cousinagam

    (@cousinagam)

    Thank you, Kafkaesqui…

    Sometimes you just have to know WHERE in the codex…

    Wow, there are at least a half dozen plug-ins on that page… πŸ™‚

    I know I can download, install and test them all out, but before I begin that endeaver is there anyone that can recommend one or two to me to get started…?

    Thanks… πŸ™‚

    Varonika, if you’re using WP2, it doesn’t hurt to be certain a plugin runs with it:

    http://codex.wordpress.org/User:Matt/2.0_Plugin_Compatibility

    Brian’s Latest Comments is listed there (there are others, but this one caught my eye), and may be worth a look:

    http://meidell.dk/archives/2005/03/21/brians-latest-comments-15/

    Sometimes you just have to know WHERE in the codex…

    Very good point, cousinagam. ;)

    Thank you for the tips, I didn’t realize how easy it was to try out plugins… I can see now that with the Plugins Manager how easy it is to try out different plugins from the admin panel…

    Thanks again… πŸ™‚

    Thread Starter cousinagam

    (@cousinagam)

    Varonika:

    On my site, I’m using a random-quote plugin: http://www.zombierobot.com/wp-quotes/

    And also a WordPress backup plugin: http://www.skippy.net/blog/plugins/

    I mention these because, as you say, it’s very easy to try them out. I am so impressed by the people who build test, test them, and make them available.

    I’m currently using this one:
    http://blog.jodies.de/archiv/2004/11/13/recent-comments/

    spencerp

    I installed Recent Comments by Jodies but I don’t want it in the sidebar but in a page.
    I try to put the code in the page template and the recent comments appear in all the pages.
    Where can I put the code to have the recent comments in one page only ?
    Many thanks

    http://13770.org/

    13770, when you say page template do you mean page.php?

    In any case, you can place the plugin’s tag(s) inside this if statement, which will make sure to display what’s in it only when on a Page:

    <?php if(is_page()) : ?>
    ~ recent comment stuff ~
    <?php endif; ?>

    Cousinagam:

    Thanks for those tips. I downloaded the Simpsons Random Quote generator but I haven’t installed it yet. I also have the backup plugin from skippy.net. Hehe, I don’t even remember uploading that one to my server, it must have been one night at 3am when I was half asleep.

    Like a lot of you, I decided to use the recent comments plugin from blog.jodies.de. I put it in my sidebar and it is working out very nicely for me.

    I really like this blog software – it is better than any I have seen so far.

    I have another question but I’ll try to see if I can search the Codex before I ask. πŸ™‚

    I also have the backup plugin from skippy.net.

    That one comes with WordPress 2.0. So no need for concern that you’re losing your memory or anything like that. ;)

    Attention Kafkaesqui
    Yes I mean page.php
    I know nothing in php and don’t know where I have to put the code… and what must be the code…
    I suppose that ~ recent comment stuff ~ must be replaced by the name of the page, between ~ ~ ?
    Thanks

    13700, let’s go through it:

    1. You mention a Recent Comments plugin. This would have at the very least a “template tag” one is required to add to a template to display those comments. This is what’s referred to by ~ recent comment stuff ~.

    2. The code I list above would be added to the template where you want the comments to appear. If this is in a sidebar, this would typically be the sidebar.php template. If you want it displayed on a Page somewhat where a Page’s content usually displays, then it would be your page.php (or index.php when no page.php exists with a theme).

    3. To display recent comments on a *specific* Page, you have two options:

    * Change the if statement to:

    <?php if(is_page('Page Title')) : ?>

    This tests on whether we are not only on a Page, but the Page has the title of Page Title. More information on restricting is_page() is found here:

    http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page

    * You can set up a custom Page template using the Recent Comments tag/code/whatever (copying your current page.php and editing the copy is easiest for this) and assign that template to the Page(s) you want to display it on. More on custom Page templates can be found here:

    http://codex.wordpress.org/Pages#Creating_your_own_Page_Templates

    Note in this case you don’t need the is_page() code from above, since assigning a Page template to a specific Page provides the restriction you’re looking for.

    At the bottom, this is my page.php

    What can I do to obtain the recent comments only on a page called Commentaires ?
    Thanks
    DD
    ————————————
    <?php get_header(); ?>

    <div id=”content” class=”narrowcolumn”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class=”post”>
    <h2 id=”post-<?php the_ID(); ?>”><?php the_title(); ?></h2>
    <div class=”entrytext”>
    <?php the_content(‘<p class=”serif”>Lire le reste de cette page »</p>’); ?>

    <?php link_pages(‘<p>Pages : ‘, ‘</p>’, ‘number’); ?>

    </div>

    <?php if (function_exists(‘get_recent_comments’)) { ?>

    • <h2><?php _e(‘Commentaires rΓ©cents :’); ?></h2>
      <?php get_recent_comments(); ?>

    <?php } ?>
    </div>
    <?php endwhile; endif; ?>
    <?php edit_post_link(‘Modifier cette page.’, ‘<p>’, ‘</p>’); ?>
    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>
    ———————————————–

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Recent comments in sidebar?’ is closed to new replies.