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.

NEW BUNDLE ALERT

5 Tools, 50+ Sites
1 License

The FooGallery Agency Bundle is now available with both annual and lifetime payment options

Launch Discount Included