Title: HTML Code for &#8220;Latest Posts?&#8221;
Last modified: August 18, 2016

---

# HTML Code for “Latest Posts?”

 *  [insaneelf](https://wordpress.org/support/users/insaneelf/)
 * (@insaneelf)
 * [20 years ago](https://wordpress.org/support/topic/html-code-for-latest-posts/)
 * Hi, does anyone know the HTML code that I can insert into the sidebar for the“
   Latest Posts” thing? Don’t tell me to use the widget either. (I don’t feel like
   explaining why.)
 * Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [monkeypup](https://wordpress.org/support/users/monkeypup/)
 * (@monkeypup)
 * [20 years ago](https://wordpress.org/support/topic/html-code-for-latest-posts/#post-394397)
 * well, html won’t do. ya need some good ol’ php.
    [here’s a link](http://codex.wordpress.org/Template_Tags/get_posts)
   to what ya need in the codex.
 *  Thread Starter [insaneelf](https://wordpress.org/support/users/insaneelf/)
 * (@insaneelf)
 * [20 years ago](https://wordpress.org/support/topic/html-code-for-latest-posts/#post-394405)
 * So there’s no code for the actual widget itself? One that I could just enter 
   into the sidebar file? My knowledge of php is…lacking. :S I would use widgets,
   but for some reason, when I drag and drop them, they don’t work…I even had them
   working before, until I reworked my sidebar file.
 *  [monkeypup](https://wordpress.org/support/users/monkeypup/)
 * (@monkeypup)
 * [20 years ago](https://wordpress.org/support/topic/html-code-for-latest-posts/#post-394414)
 * ahhhh. you said a mouthful. You reworked your sidebar.
    If your sidebar doesn’t
   have the right command, widgets won’t work for squat. Possibly you deleted some
   part or all of that command when you reworked the sidebar.
 * This might work:
 * Open your sidebar.php and look for something like this:
 * `
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?
   >
 * Should be at the top. Also, at the bottom should be something like this:
 * `
    <?php endif; ?>
 * If one of those is missing, well, it’s not going to work.
 * Check out [this page](http://automattic.com/code/widgets/themes/) for more like
   this.
 * Another reason your widgets would not work is if the javascript folder is in 
   the wrong place. But, if you can drag and drop with no problem in the widget 
   screen, that’s not the problem. If you can drag, but not drop? That’s the problem.
 * If you still need help, you can mail me at:
    monkeypup AT gmail DOT com
 *  [VeronicaRose](https://wordpress.org/support/users/veronicarose/)
 * (@veronicarose)
 * [20 years ago](https://wordpress.org/support/topic/html-code-for-latest-posts/#post-394415)
 * This is what I have in my sidebar to make the last five posts appear:
 * <?php get_archives(‘postbypost’, 5, ‘html’, ”, ”, false) ?>
 *  [VeronicaRose](https://wordpress.org/support/users/veronicarose/)
 * (@veronicarose)
 * [20 years ago](https://wordpress.org/support/topic/html-code-for-latest-posts/#post-394430)
 * P.S. I’m not using my most recent posts right now, so if anyone comes to my site
   expecting to see what this looks like you might be disappointed. Just thought
   I should let you know. But it does work.
 *  Thread Starter [insaneelf](https://wordpress.org/support/users/insaneelf/)
 * (@insaneelf)
 * [20 years ago](https://wordpress.org/support/topic/html-code-for-latest-posts/#post-394438)
 * Um, where exactly in the sidebar.php file do I add “<?php if ( !function_exists(‘
   dynamic_sidebar’)
    || !dynamic_sidebar() ) : ?>” and the other one?
 *  [VeronicaRose](https://wordpress.org/support/users/veronicarose/)
 * (@veronicarose)
 * [20 years ago](https://wordpress.org/support/topic/html-code-for-latest-posts/#post-394447)
 * Edit: my post was not really necessary, was it?
    – deleted
 *  [monkeypup](https://wordpress.org/support/users/monkeypup/)
 * (@monkeypup)
 * [20 years ago](https://wordpress.org/support/topic/html-code-for-latest-posts/#post-394573)
 * hey, InsaneElf – email me your sidebar.php file and I can make sure it works 
   and all checks out. Since I don’t know what your sidebar.php file looks like 
   after your changes, I can’t tell you where to add it.
 * monkeypup at gmail dot com
 *  Thread Starter [insaneelf](https://wordpress.org/support/users/insaneelf/)
 * (@insaneelf)
 * [20 years ago](https://wordpress.org/support/topic/html-code-for-latest-posts/#post-394621)
 * Will do.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘HTML Code for “Latest Posts?”’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 3 participants
 * Last reply from: [insaneelf](https://wordpress.org/support/users/insaneelf/)
 * Last activity: [20 years ago](https://wordpress.org/support/topic/html-code-for-latest-posts/#post-394621)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
