Reputation: 41
When I'm designing Wordpress sites for clients, many of the theme designs I use consist of several posts, each with one photo and a bit of text. As a result, I end up spending lots of time creating lots of posts with one picture each-- just so the layout works as expected. It seems like there should be a way to bulk add images to the Media folder (I use the Add from Server plugin) and then tell WP to create a bunch of separate posts containing one photo each.
Does anyone know how to do this? It seems like professional theme designers would get a lot of use out of a plugin that did this automatically.
Thanks! Chimera
Upvotes: 1
Views: 2729
Reputation: 1292
I looked around for a solution to this problem too, but just ended up writing my own plugin to do it.
If you wanted to do it yourself,
global $user_ID;
$new_post = array(
'post_title' => 'My New Post',
'post_content' => 'Lorem ipsum dolor sit amet...',
'post_status' => 'publish',
'post_date' => date('Y-m-d H:i:s'),
'post_author' => $user_ID,
'post_type' => 'post',
'post_category' => array(0)
);
$post_id = wp_insert_post($new_post);
and there is good info in the docs:
Upvotes: 1