Hi all,
I'm new to WP and PHP as well. Therefore, I'm sorry in advance for the newbie question.
I tried to used the code below in order to show a list of my posts on a page called blog-example.php. However, nothing is displayed on the page. What am I doing wrong?
Details:
The blog-example.php file is in the root folder and the blog folder is there as well.
When I view source it seems like it encounters an error after it requires the wp-blog-header.php file.
//blog-example.php code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
require('blog/wp-blog-header.php');
?>
<?php
$posts = get_posts('numberposts=10&order=ASC&orderby=post_title');
foreach ($posts as $post) : start_wp(); ?>
<?php the_date(); echo "<br />"; ?>
<?php the_title(); ?>
<?php the_excerpt(); ?>
<?php
endforeach;
?>
</body>
</html>
I thank you all for your help