Jump to content

How come feeding posts from sufolder not allowed?


bgbs

Recommended Posts

This php script is driving me insane.

This is a simple script which pulls wordpress titles from news directory. It works if I put this code on homepage file.

But if I launch this script in a file that is in a sub folder then I get an error even though I do specify  require('../news/wp-blog-header.php'); to go back to top level.  If I insert the full http:// path, it doesnt work at all.

 

Does anyone know why?

 

 

<?php
// Include Wordpress 
define('WP_USE_THEMES', false);
require('news/wp-blog-header.php');
query_posts('showposts=3');
?><?php while (have_posts()): the_post(); ?>

<a href="<?php the_permalink(); ?>"><p class="border"><?php the_title(); ?></p></a>
<?php endwhile; ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.