Adding Images
Images are managed through the Gallery Control component in the block editor:Image Metadata
Title and Description Sources
You can choose where titles and descriptions come from:none- No title displayedcustom- Use custom title from gallery controltitle- WordPress attachment titlecaption- WordPress attachment captionalt- WordPress attachment alt textdescription- WordPress attachment description
When using WordPress attachment metadata, the plugin automatically queries attachment data from
/classes/class-get-portfolio.php:1350-1429.Image Categories
Create custom categories for filtering and organization:- Dynamic: Create them on-the-fly
- Filterable: Used for client-side filtering
- Bulk Editable: Apply to multiple images at once
Image Formats
Standard Format
Regular image display:Video Format
Embed videos with image thumbnails:- YouTube
- Vimeo
- Wistia
- Self-hosted videos
- See full list
Custom URLs
Override the default popup behavior with custom links:Author Information
Add author credits to images:Focal Point
Control image cropping focus:Ordering Images
Order By
Control how images are sorted:default- Manual order (drag and drop)title- Item titledescription- Item descriptionimage_title- Attachment titleimage_caption- Attachment captionimage_alt- Attachment alt textimage_description- Attachment descriptiondate- Upload daterand- Random order
Order Direction
- ASC: Ascending (A-Z, oldest-newest)
- DESC: Descending (Z-A, newest-oldest)
Manual order (
default) respects your drag-and-drop arrangement in the editor and ignores the order direction setting.Query Processing
The image query logic in/classes/class-get-portfolio.php:1306-1532 processes images as follows:
1. Load Image Data
2. Apply Category Filtering
When a filter is active:3. Fetch Attachment Data
Load WordPress attachment metadata:4. Apply Sorting
For non-random sorting:5. Paginate Results
Image Item Output
Each image is rendered with these properties:Gallery Control Component
The gallery control is defined in/classes/class-admin.php:1643-1730 and provides:
Image Controls
Bulk Editing
Controls withallow_bulk_edit can be applied to multiple images simultaneously:
- Categories
- Format
- Author name
- Author URL
Example Configurations
Basic Image Gallery
Categorized Portfolio with Videos
Random Gallery with Author Credits
Filters and Hooks
Modify Image Item Args
Customize image output data:Get All Categories
The gallery control provides a utility to get all unique categories:Performance Tips
- Image Optimization: Use properly sized images (WordPress generates thumbnails automatically)
- Limit Count: Keep
items_countreasonable for initial load performance - Lazy Loading: Visual Portfolio includes built-in lazy loading
- Category Filtering: Client-side filtering is instant with no server requests
Related Resources
- Posts Query - WordPress post-based content
- Manual Selection - Selecting specific items
- Portfolio Items - Portfolio custom post type