Get the Title of all posts

Posted by danit on Stack Overflow See other posts from Stack Overflow or by danit
Published on 2010-04-11T14:14:56Z Indexed on 2010/04/11 16:13 UTC
Read the original article Hit count: 215

Filed under:
|

Im using Wordpress, Im also creating posts via XMLRPC based on an RSS feed that is added to periodically.

What I want is to read all post titles, compare those against the RSS feed, then only post to Wordpress where the post titles dont exist.

I'm trying this code:

<?php
define('WP_USE_THEMES', false);
require('../wp-load.php');
query_posts('showposts=-1&author=1&post_status=publish');
?>

<?php while (have_posts()): the_post(); ?>

<?php the_title(); ?>

<?php endwhile; ?>

This gets all titles from published posts, I then need to do the same to get the draft posts.

I need to write these title's to an array?

© Stack Overflow or respective owner

Related posts about Wordpress

Related posts about php