Show wordpress posts outside of the blog

Posted by way2project on Stack Overflow See other posts from Stack Overflow or by way2project
Published on 2012-07-23T18:13:58Z Indexed on 2012/11/04 5:01 UTC
Read the original article Hit count: 257

Filed under:
|
|

I have two wordpress blogs on my site and now I want to show the posts of categories of both blogs on the home page. I am using the following code.

<?php require($_SERVER['DOCUMENT_ROOT'] . '/projects/wp-load.php'); 
 query_posts('cat=9& showposts=8');  if (have_posts()) : while (have_posts()) :   
the_post(); ?>
<ul><li>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php 
$shorttitle4 = substr(the_title('','',FALSE),0,25)."...";

echo $shorttitle4;
?></a>

</li></ul>
<?php endwhile; else: echo "no posts"; endif; ?>
<?php wp_reset_query(); ?>

One of my blogs is placed in the "projects" folder and another one is placed in "technology folder". but this code is showing the posts only from projects blogs if I changed the folder in as "technology" in the above code. I think this is because of wp-load.php file. Can you help me?

Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about Wordpress