WordPress.org

Ready to get started?Download WordPress

Forums

HTML Code for "Latest Posts?" (10 posts)

  1. inSaneELF
    Member
    Posted 8 years ago #

    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.

  2. monkeypup
    Member
    Posted 8 years ago #

    well, html won't do. ya need some good ol' php.
    here's a link to what ya need in the codex.

  3. inSaneELF
    Member
    Posted 8 years ago #

    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.

  4. monkeypup
    Member
    Posted 8 years ago #

    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 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

  5. VeronicaRose
    Member
    Posted 8 years ago #

    This is what I have in my sidebar to make the last five posts appear:

    <?php get_archives('postbypost', 5, 'html', '', '', false) ?>

  6. VeronicaRose
    Member
    Posted 8 years ago #

    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.

  7. inSaneELF
    Member
    Posted 8 years ago #

    Um, where exactly in the sidebar.php file do I add "<?php if ( !function_exists('dynamic_sidebar')
    || !dynamic_sidebar() ) : ?>" and the other one?

  8. VeronicaRose
    Member
    Posted 8 years ago #

    Edit: my post was not really necessary, was it?
    - deleted

  9. monkeypup
    Member
    Posted 8 years ago #

    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

  10. inSaneELF
    Member
    Posted 8 years ago #

    Will do.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.