• I am looking to automatically create a new gallery for each page added to a site. I figure there should be a way to do this by using functions in the functions.php page to do this. Has anyone done this before? Any help on this would be greatly appreciated. I basically want it so when they create a page, the title of the page will be the title of the gallery and the gallery will be added in the background so they will be able to go right in and start adding pictures to the gallery without having to create it.

    http://wordpress.org/plugins/nextgen-gallery/

Viewing 2 replies - 1 through 2 (of 2 total)
  • You can’t add pictures to a non-existent gallery, is a whole process, and you have only to write a name before uploading the files, so I don’t understand the problem.
    You can do the opposite instead, automatically create a new page for each gallery, clicking on “Add page” button in Manage Galleries > Gallery settings: a page will be created with the name of that gallery and the relative code inside.

    Thread Starter jayhawkerd

    (@jayhawkerd)

    I realize you can’t add pictures to a non-existent gallery; which is why I want to be able to create a gallery automatically when I create a new page in a site. I know it is normally a simple thing to just type in a name and hit save and it creates a gallery but the project I am working on is a lot more complicated than I can really explain here and I have to have names of galleries very specific and defined from the name of the page they will be created from (example: if I have a page named “Bill”, the person there will be a gallery with the name “Bill” that will be displayed on that page.) This is a multisite that will have several sites on it but that part is not the issue. I figure since it is as simple as typing in a name for a gallery and hitting save it shouldn’t be that hard to create a function that can just be called up at the end of the create new page part that can do this by passing a parameter through the function with the name I want to use for the gallery and have that gallery created. That way, when a person creates a new page, the gallery is already created for them and this will allow them to go in and add pictures to the correct gallery. This is being done to simplify what users have to do to upload pictures (this site is being created for people who are not technically inclined so we have to simplify as much as possible).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Function to Create New Gallery When Adding New Page’ is closed to new replies.