Override Create Gallery Page Content

FooGallery comes with a nifty feature to quickly create a page with which includes the gallery shortcode in a single click. Once you have published a gallery, look for the Gallery Usage metabox on the top right. If the gallery is not included in any pages or posts, then click the Create Gallery Page button. This will create a draft page with the page title set to the gallery title, and the page content will be the shortcode for the gallery.

Override The Page Content

By default, the page content will only contain the gallery shortcode, but you can override this content by adding some custom code to your site.

It is done by using the filter called foogallery_create_gallery_page_content.

The below example code shows you how to change the content:

function custom_foogallery_page_content( $content, $foogallery ) {
  return '<h2>Gallery : ' . $foogallery->name . '</h2>' . $content;
}

add_filter( 'foogallery_create_gallery_page_content', 'custom_foogallery_page_content', 10, 2 );Code language: PHP (php)

Resources

Find the right next step

Use this grid for documentation indexes, support routes, account links, affiliate resources, and download pages.

Documentation

Search setup guides, product docs, and troubleshooting articles.

Support

Open a ticket with product details so we can help quickly.

Licensing

Review account, renewal, refund, and license information.

Pricing update

Monthly & Lifetime plans are currently not unavailable

We’re not offering these payment options right now. Leave your name and email and we’ll let you know as soon as they return.

NameEmailNotify Me

No spam - Unsubscribe anytime