forked from RadoslavGeorgiev/ultimate-fields
-
Notifications
You must be signed in to change notification settings - Fork 0
Gallery
JIX edited this page Jul 14, 2020
·
1 revision
The Gallery field allows users to select a collection of images.
Once images are added to the field, its UI allows users to:
- Rearrange and remove existing images directly within the field.
- Add more images.
- Sort images by a specific criteria.
There are no additional settings available for the Gallery field.
Using a the_value
function with the value of a gallery field will use the gallery shortcode of WordPress in order to display the gallery. Using get_value
on the other hand will return an array of image IDs if available.
<!-- Display images like a gallery shortcode -->
<?php the_value( 'highlights' ) ?>
<!-- Using images manually -->
<?php
$images = get_field( 'highlights' );
if( $images ) {
foreach( $images as $image_id ) {
echo wp_get_attachment_image( $image_id, 'thumbnail' );
}
}
?>
Quick start
- Creating fields and using their values
- Installation
- Administration interface
- Using the PHP API
- Container Settings
Locations
- Overview & Usage
- Post Type
- Options Page
- Taxonomy
- Comment
- User
- Widget
- Shortcode
- Menu Item
- Attachment
- Customizer
Fields
- Fields
- Text
- Textarea
- WYSIWYG
- Password
- Checkbox
- Select
- Multiselect
- Image Select
- File
- Image
- Audio
- Video
- Gallery
- WP Object
- WP Objects
- Link
- Date
- DateTime
- Time
- Color
- Font
- Icon
- Map
- Embed
- Number
- Sidebar
- Complex
- Repeater
- Layout
- Section
- Tab
- Message
Features
- Adding fields to the Customizer
- Conditional Logic
- Front-End Forms
- Administration columns
- Import and Export
- REST API
- JSON Synchronization
- Yoast SEO
Ultimate Post Types
Functions and API
Tutorials