1

I am trying to write a simple Wordpress plugin to read an XML feed and put the data into a custom post. The data is from a property website. I can read all the information in and use wp_insert_post( $mypost, $wp_error ); to create the new post and I can set the terms and update the meta for this post, but I am stumped when trying to get the images into Nextgen gallery.

I can read all the urls for the images. What I would like to do, is create a new gallery for a property, then add the images to this gallery.

I have tried nggAdmin::create_gallery($title, $defaultpath); and also

$result = $wpdb->query("
    INSERT INTO $wpdb->nggallery (name, slug, path, title, galdesc, pageid, previewpic, author)
    VALUES (‘testgallery’, ‘testgallery’, ‘wp-content/gallery/testgallery’, ‘testgallery’, ”, 0, 0, 1)";

I just get a blank screen.

Can someone tell me what INCLUDES to put in the file and how to call the functions needed from Nextgen gallery.

0 Answers0