• I would like to get a list of the 20 most recent posts in the sidebar.

    I found something that seemed to say that

      <?php wp_get_archives(‘postbypost’,’20’, ‘html’); ?>

    would do it, but rather than a list of the posts, it just gives me one line per month, which it would seem would be done if I had said monthly rather than postbypost

    What am I missing?

    And I saw something else that left the wp_ off, but that did not seem to work at all. What is the difference between wp_get_archives and get_archives

Viewing 3 replies - 1 through 3 (of 3 total)
  • I like the plugin from MtDewVirus:
    https://mtdewvirus.com/code/wordpress-plugins/

    I know the method you use exists but I found the plugin offered me a better result.

    Try this:
    <?php wp_get_archives('type=postbypost&limit=20&format=html'); ?>

    The difference between wp_get_archives() and get_archives() is that the former will send its output directly to the visitor, while the latter will be returned for use by you.

    wp_get_archives() basically just does this: echo get_archives($options);

    Thread Starter singleton

    (@singleton)

    On the MtDewVirus how do I add that plugin?

    On the ‘type=postbypost&limit=20&format=html’ that worked. Thank you.

    Why did the ‘postbypost’,’20’, ‘html’ not work? It is what I saw in one of the doc files for postbypost

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Listing of recent posts’ is closed to new replies.