Jump to content


Photo

Wordpress - website intergration


  • Please log in to reply
3 replies to this topic

#1 Trevsweb

Trevsweb

    Young Padawan

  • Members
  • Pip
  • 83 posts
  • Gender:Male
  • Location:London, UK
  • Interests:the usual GFX and coding

Posted 23 March 2009 - 07:58 AM

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

#2 Jacorre

Jacorre

    P2L Jedi

  • Members
  • PipPipPip
  • 824 posts
  • Gender:Male
  • Location:USA
  • Interests:Computers, Technology, Internet, Graphic/Web Design, Music, Soccer

Posted 23 March 2009 - 02:58 PM

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.

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>

Edited by Jacorre, 23 March 2009 - 02:59 PM.


#3 Trevsweb

Trevsweb

    Young Padawan

  • Members
  • Pip
  • 83 posts
  • Gender:Male
  • Location:London, UK
  • Interests:the usual GFX and coding

Posted 26 March 2009 - 06:10 AM

and this can be called on any standard php static website? looks like its missing something.
cheers for the start

just found http://www.corvidwor...-on-other-pages going to see if it leads to the right direction

Edited by Trevsweb, 26 March 2009 - 06:13 AM.


#4 Jacorre

Jacorre

    P2L Jedi

  • Members
  • PipPipPip
  • 824 posts
  • Gender:Male
  • Location:USA
  • Interests:Computers, Technology, Internet, Graphic/Web Design, Music, Soccer

Posted 02 May 2009 - 08:59 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users