Skip to main content
The Image Gallery content source allows you to create custom image collections with full control over titles, descriptions, categories, and display order. This is ideal for portfolios, photo galleries, and image showcases that don’t require WordPress posts.

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:
Title Source Options:
  • none - No title displayed
  • custom - Use custom title from gallery control
  • title - WordPress attachment title
  • caption - WordPress attachment caption
  • alt - WordPress attachment alt text
  • description - 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:
Categories are:
  • 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:
Supported video platforms:

Custom URLs

Override the default popup behavior with custom links:
When set, clicking the image navigates to this URL instead of opening a popup.

Author Information

Add author credits to images:

Focal Point

Control image cropping focus:

Ordering Images

Order By

Control how images are sorted:
Available options:
  • default - Manual order (drag and drop)
  • title - Item title
  • description - Item description
  • image_title - Attachment title
  • image_caption - Attachment caption
  • image_alt - Attachment alt text
  • image_description - Attachment description
  • date - Upload date
  • rand - 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:
For random sorting (with session-based seeding):

5. Paginate Results

Image Item Output

Each image is rendered with these properties:
The gallery control is defined in /classes/class-admin.php:1643-1730 and provides:

Image Controls

Bulk Editing

Controls with allow_bulk_edit can be applied to multiple images simultaneously:
  • Categories
  • Format
  • Author name
  • Author URL

Example Configurations

Categorized Portfolio with Videos

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

  1. Image Optimization: Use properly sized images (WordPress generates thumbnails automatically)
  2. Limit Count: Keep items_count reasonable for initial load performance
  3. Lazy Loading: Visual Portfolio includes built-in lazy loading
  4. Category Filtering: Client-side filtering is instant with no server requests