bgbs Posted November 24, 2009 Share Posted November 24, 2009 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; ?> Link to comment https://forums.phpfreaks.com/topic/182851-how-come-feeding-posts-from-sufolder-not-allowed/ Share on other sites More sharing options...
Virvo Posted November 25, 2009 Share Posted November 25, 2009 try using the FULL path to the file... e.g. require('/path/to/public_html/news/wp-blog-header.php'); Link to comment https://forums.phpfreaks.com/topic/182851-how-come-feeding-posts-from-sufolder-not-allowed/#findComment-965186 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.