WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/gallery shortcode

Contents

Description

The Gallery shortcode. This implements the functionality of the Gallery Shortcode for displaying WordPress images on a post.

Parameters

$attr
(array) (required) The shortcode attributes.
Default: None

Return

(string) 
The HTML content to display the gallery.

Usage

 <?php gallery_shortcode$attr ); ?> 

Example

Adds the gallery shortcode.

add_shortcode( 'gallery', 'gallery_shortcode' );

Change Log

Source File

gallery_shortcode() is located in wp-includes/media.php.

Related