Hi,
I am trying to show the latest posts for a category(ies) on a non-wordpress site. I used to do this with a somple sql query but since the change to 2.3 I can't do that any more.
Instead, I have tried using:
function showHeadlines($entrytype = '', $items = 4)
{
require('wordpress/wp-blog-header.php');
$query = 'showposts=' . $items;
if ($entrytype != '')
$query .= '&cat=' . $entrytype;
query_posts($query);
if ($posts) : foreach ($posts as $post) : start_wp();
$blogContent = get_the_content();
?>
<a>'><?php the_time(’d/m/Y’); ?>: <?php the_title(); ?></a>\n";
<small><?php add3dots(strip_tags($blogContent),"...",170)?></small> <a>'>Full Story: <?php the_title(); ?></a>
";
<?php endforeach; else: ?>
<?php endif; ?>
<?}
Where $entrytype is the comma list of cat id's.
I found this code on this forum, and on another site, both times it seems to have worked for the person asking, however I am getting an error:
'Fatal error: Call to a member function hide_errors() on a non-object in /wordpress/wp-includes/functions.php on line 895'
Can anybody help fix this, or suggest a better way? I don't really want to use RSS as there is too much overhead with that.
Thanks in advance.
Tim