首页 WordPress函数大全 gallery_shortcode()

gallery_shortcode()

2020-05-01 / 2766阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

gallery_shortcode( array $attr )

Builds the Gallery shortcode output.

描述

This implements the functionality of the Gallery Shortcode for displaying WordPress images>

参数

$attr

(array)
(Required)
Attributes of the gallery shortcode.

  • 'order'
    (string) Order of the images in the gallery. Default 'ASC'. Accepts 'ASC', 'DESC'.
  • 'orderby'
    (string) The field to use when ordering the images. Default 'menu_order ID'. Accepts any valid SQL ORDERBY statement.
  • 'id'
    (int) Post ID.
  • 'itemtag'
    (string) HTML tag to use for each image in the gallery. Default 'dl', or 'figure' when the theme registers HTML5 gallery support.
  • 'icontag'
    (string) HTML tag to use for each image's icon. Default 'dt', or 'div' when the theme registers HTML5 gallery support.
  • 'captiontag'
    (string) HTML tag to use for each image's caption. Default 'dd', or 'figcaption' when the theme registers HTML5 gallery support.
  • 'columns'
    (int) Number of columns of images to display. Default 3.
  • 'size'
    (string|array) Size of the images to display. Accepts any valid image size, or an array of width and height values in pixels (in that order). Default 'thumbnail'.
  • 'ids'
    (string) A comma-separated list of IDs of attachments to display. Default empty.
  • 'include'
    (string) A comma-separated list of IDs of attachments to include. Default empty.
  • 'exclude'
    (string) A comma-separated list of IDs of attachments to exclude. Default empty.
  • 'link'
    (string) What to link each image to. Default empty (links to the attachment page). Accepts 'file', 'none'.

返回

(string) HTML content to display gallery.

大家谈论
    我的见解