WordPress.org

Ready to get started?Download WordPress

Forums

Autopost images every 2 hours from Media Library (2 posts)

  1. seraph1976
    Member
    Posted 1 year ago #

    hi

    i want create a autoblog with images. i upload all images to the wordpress media library and i want wp a create automatic every 2 hours a post with 1 image from the libray. only the images, no text.

    how can i do that, with plugins?

  2. Steven Jones
    Member
    Posted 1 year ago #

    The way I would do would be to

    1. Create a new meta field for each attachement called 'posted'.
    2. Create a function that creates a post wp_insert_post() and inserts an img tag with the next image in the media library (that does not have posted set to true) into the post content. Ensure that the image used gets 'posted' set to true.
    3. Schedule a wp_cron() job to run the function every two hours

    Good luck.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.