WordPress.org

Support

Support » Themes and Templates » recent posts by category?

recent posts by category?

  • i want to put 5 0r 10 recent posts from specific categories on certain pages throughout my site.
    i have looked over the various topics for “recent posts” and while it seems that using archives is the best way, the only result i get from adding the code
    <?php get_archives('postbypost','20','html'); ? >
    to my side bar is a long list of all the entries in all the categories. how do i know what the ’20’ and ‘html’ additions mean in this application?
    how can i call all the posts from the archives in category 20 in the sidebar of a given page?
    is there a simple answer for this?
    please help.

Viewing 15 replies - 1 through 15 (of 25 total)
  • What exactly do you mean by “certain pages”?

    I have broken my site into “sections.” rather than installing individual copies of WP for my Journal, Essays, News, etc… i have used sub folders, separate css, index.php, and often sub.php files to help the site’s readers know where they are, and have a more interesting experience.

    Do you mean, for example, when someone is purusing a specific category then the recent entries list shows only the newest entries in this category?

    Yes, so on each unique index (for each unique section) it would be ideal if the recent posts from that section were called into the sidebar for easy reference by the reader.
    I am going to follow the above suggestion and read up on http://wiki.wordpress.org/get_archives .
    i’ll post my findings here if you are interested.

    < ul >
    < li id="archives" >Recent Entries:
    < ?php get_archives('postbypost','10','html'); ? >< /p >
    < /ul >< /li >

    bah… this looks terrible, and isn’t really anything i can tell what to grab.
    and yet, it’s right there in the narchives.php…
    llike it’s a hair on my tongue…
    driving me insane…
    cack-cack…

    i give up…
    i am calling friends now, asking for a ride to the hospital. i need to be drained, steamed, folded into a crisp brown bag, and saved for later tonight.
    71 hours… no love.
    dss

    So, still no solution for this? This would be a very cool feature…

    is dss guy still alive?

    What’s the verdict?

    This is a very useful feature.

    someone else wrote an Ugly Hack around this; noone’s written something more pluggable. don’t know why this couldn’t be a plugin instead of the ugly hack, though.

    j.

    Coffee2Code’s Customizable Post Listings

    This is the type of thing that my WP-Exec plugin is exactly for. Unfortunately, for some oddities, my plugin has got no love even though I think its pretty damn useful!

    http://www.navidazimi.com/projects/wp-exec/

    Then, in ANY post or page, simply add:

    <ul>
    <exec type="function" name="get_archives" params="postbypost, 20, html" />
    </ul>

    Pretty damn sweet huh? But no, nobody loves Navid and his hard work.

    The Bitter One.

    Well, your plugin is relatively new, so you need to promote it more 🙂
    Did you list it in wiki page, by the way?

    Thanks for trying to make me feel better alphaoide. I added it to the Wiki. Let’s see if I get some love now.

    hey how does the exec help get recent posts by category?

    I did a plugin for this last summer. Not tested with 1.5 yet, but it’s rightcat.tar.gz, downloadable from http://pericat.ca/downloads/

    For what it’s worth, the photolog, where I’ve been using it since, is here.

    navid, I guess you could use the ‘function’ option in your plugin for this? I don’t see how to do it straightforwardly, though. An example on your site might be good.

    Pericat, four replies above your post I already posted the sample code:

    <ul>
    <exec type="function" name="get_archives" params="postbypost, 20, html" />
    </ul>

    Enjoy.

    That was me, navid, not pericat. :)

    This does not, though, display posts from a particular category.

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘recent posts by category?’ is closed to new replies.