Help - Search - Members - Calendar
Full Version: Wordpress - website intergration
Pixel2Life Forum > Help Section > General Help
Trevsweb
Well i'm trying to get the latest 5 posts from my wordpress on the side of my website. i tried searching the wordpress site but found nothing... i feel im using the wrong terminology in my search strings.

example:
can anyone help me either find a tut or get the code i need

cheers
Jacorre
You should look into the query_posts template tag.

The query_posts function is intended to be used to modify the main page Loop only. It is not intended as a means to create secondary Loops on the page. If you want to create separate Loops outside of the main one, you should create separate WP_Query objects and use those instead. Use of query_posts on Loops other than the main one can result in your main Loop becoming incorrect and possibly displaying things that you were not expecting.

The query_posts function overrides and replaces the main query for the page. To save your sanity, do not use it for any other purpose.

CODE
Recent
<ul class="recent-posts">
  <?php
    $archive_query = new WP_Query('showposts=5');
    while ($archive_query->have_posts()) : $archive_query->the_post(); ?>
  <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li>
  <?php endwhile; ?>
</ul>
Trevsweb
and this can be called on any standard php static website? looks like its missing something.
cheers for the start

just found http://www.corvidworks.com/articles/wordpr...-on-other-pages going to see if it leads to the right direction
Jacorre
You may have to pull in your rss feed so it can pull the latest 5 entries. I'm pretty sure there's tools out there for doing that.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.