WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Using Get Recent Comments widget twice (16 posts)

  1. haussamen
    Member
    Posted 4 years ago #

    Hi,

    I'm looking for a way to use the Get Recent Comments widget twice on the same site -- http://nmpolitics.net. Anyone know how to do that?

  2. Maiskolben
    Member
    Posted 4 years ago #

    I think this ain't twice recent comment widges... The first with the photographs are pickedup manually or by an other plugin, imo..

  3. Jonas Grumby
    Member
    Posted 4 years ago #

    Recent Comments is not there twice.

  4. haussamen
    Member
    Posted 4 years ago #

    I'm talking about the section at the bottom of the left column titled "Recent comments." I'd like to be able to use that widget twice, but when I put it into the left column, it's not also left behind in the widgets area for me to put in a second time somewhere else on the site.

  5. Jonas Grumby
    Member
    Posted 4 years ago #

    If the widget is not designed to be used multiple times it can't be. This is becoming a greater issue with themes that allow you to show different sidebars on different pages.

  6. haussamen
    Member
    Posted 4 years ago #

    So there's no way to manipulate it?

  7. Maiskolben
    Member
    Posted 4 years ago #

    Even post it to another question, maybe you can handle it with (post this anywhere out of your sidebar):

    <?php if (function_exists('get_recent_comments')) { ?>
    <h2><?php _e('Recent Comments:'); ?></h2>
    <p><?php get_recent_comments(); ?></p>
    <?php } ?>

    It's a bit tricky, but not impossible I think...

  8. Jonas Grumby
    Member
    Posted 4 years ago #

    Yes you can hard-code it in if you know how. If you are using widgets, your code has to be outside the dynamic area of the sidebar.

  9. haussamen
    Member
    Posted 4 years ago #

    Maiskolben, what code would I add to that to have it appear only on the home page? I do use Widget Logic, so I assume it somehow includes the code "!is_home()."

  10. Maiskolben
    Member
    Posted 4 years ago #

    yes, you're right! And viĆ” cascading stylesheets you can post hardcoded stuff within your sidebar but under the dynamic area, and make it looks like the sidebar as well...

  11. Jonas Grumby
    Member
    Posted 4 years ago #

    It can also be above the dynamic area.

  12. Jonas Grumby
    Member
    Posted 4 years ago #

    and if you hard-code it, you can use Conditional Tags to make it only appear on certain pages.

  13. Maiskolben
    Member
    Posted 4 years ago #

    I guess something like that, it's not tested...

    <?php if (is_home() || function_exists('get_recent_comments')) { ?>
    <h2><?php _e('Recent Comments:'); ?></h2>
    <p><?php get_recent_comments(); ?></p>
    <?php } ?>
  14. Maiskolben
    Member
    Posted 4 years ago #

    @SS_Minnow: Cool! ^^ thanks for that link!

  15. haussamen
    Member
    Posted 4 years ago #

    I even have the php code widget, so I plugged that code into a widget instead of into the page code and it worked great.

    Thanks for the help!

  16. Jonas Grumby
    Member
    Posted 4 years ago #

    Good idea to use the php code widget. Glad it worked.

Topic Closed

This topic has been closed to new replies.

About this Topic