• supergab

    (@supergab)


    I’m trying to use the wp_widget_recent_comments function to show the recents comments in my sidebar but I don’t which arguments I must use in order to make it work properly.

    Can someone tell me please?

Viewing 3 replies - 1 through 3 (of 3 total)
  • theapparatus

    (@theapparatus)

    You don’t add in that function directly to your theme. You can use the built in widget though if you;re using a theme that support widgets: Dashboard -> Presentation -> Widgets.

    Hello,
    If you want use wp_widget_recent_comments functions,you should read the code of this function in widgets.php.It shows we can use it like this:wp_widget_recent_comments functions($args)
    So,for example,I think you can use it like this:
    wp_widget_recent_comments(array(‘number’ => 5));

    Good luck,
    best
    https://needgoogle.cn

    Hi,
    I had wrote how to use wp_widget_recent_comments()
    my content:
    for example,if you wang to show recent 10 comments,you should do it like this:

    1:

    wp_widget_recent_comments(array(’number’ => 10));

    Or you can directly write your code like this:

    2:

    <?php

    $hi_Iam_comments=array();

    wp_widget_recene_comments($hi_iam_comments);

    ?>

    So,it is very simple,right?Maybe you want to know if I do it like “2″,so where can I set how many posts in my sidebar?OK,it is set by your option in admin area.

    Best,
    https://needgoogle.cn

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using wp_widget_recent_comments in sidebar.php ?’ is closed to new replies.