ThemeShaper Forums » Thematic

Using "get_posts"..

(5 posts)
  • Started 10 years ago by richidi
  • Latest reply from amygail
  • This topic is not resolved
  1. richidi


    I know that there is way to use "get_posts" to show my posts in a static homepage. I just can't do that with my low-level php skils. So I'm asking help..

    This is what I'd like show in my site homepage:

    3 latest posts from the blog. Showing only post-title, date and the post itself.. Post_footer can be there. I used filter to customize it already.

    This "latest post" area is meant to be in page_bottom(thematic). Is that possible? Thank you already. :)

    Posted 10 years ago #
  2. richidi

    I tried this..

    $postslist = get_posts('numberposts=10&order=ASC&orderby=date');
    foreach ($postslist as $post) :
    <?php the_date(); ?>

    <?php the_title(); ?>
    <?php the_excerpt(); ?>
    <?php endforeach; ?>

    Unfortunately it caused this:

    "This tag can be used anywhere within a template as long as it's outside The Loop on the main page, though is typically used in the <title> element for the head of a page." <- wp_title

    Is there any way to do this? Or should I just use latest post widget? Is there possibility to add date + excerpt to the widgets output..?

    Posted 10 years ago #
  3. amygail

    I'm probably missing something - but why don't you just use the option (in settings > reading)...

    to have the front page show 'Your latest posts' and set "Blog pages show at most" 3 posts?

    Then just list your 'latest posts' in a widget in whatever area you want? (page-bottom etc)

    Posted 10 years ago #
  4. richidi

    Becouse I've already have blog page which shows all the posts.. I just wan't have three newest in my homepage :D

    I think I should use something like this (needs little more though :D)
    <?php wp_get_archives('title_li=&type=postbypost&limit=3'); ?>

    Not get_posts..

    Posted 10 years ago #
  5. amygail

RSS feed for this topic


You must log in to post.