Get the Title of all posts
- by danit
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?