Skip to main content

Overview

Visual Portfolio supports three primary content sources for building galleries and portfolios. Each source type has its own configuration options and use cases.
Content sources are defined in the content_source control at classes/class-admin.php:1309

Content Source Types

Post-Based Content

Display WordPress posts, pages, custom post types, or portfolio items. Configuration:
Post Source Options:
Select from available WordPress post types:
Query Controls:

Images Content

Display a custom gallery from WordPress Media Library images. Configuration:
Image Options:
Images source is ideal for creating standalone galleries without requiring post content.
Image Attributes:
  • id - WordPress attachment ID
  • url - Full image URL
  • title - Image title from media library
  • description - Full image description
  • caption - Short caption text
  • alt - Alternative text for accessibility
  • focal_point - Custom focal point (Pro feature)

Social Stream Content

Display content from social media platforms (Pro feature). Configuration:
Social Stream is a premium feature available in Visual Portfolio Pro. See the Pro documentation for details.

Implementation Details

Content Source Registration

Query Building

The Visual_Portfolio_Get class handles query building:

Archive Mapping

Visual Portfolio can automatically replace WordPress archive pages with portfolio layouts:
Archive Page Setup:
1

Enable Portfolio Post Type

Enable the Portfolio post type in Settings > General
2

Select Archive Page

Choose a page to serve as your portfolio archive
3

Configure Items Per Page

Set pagination for archive:

Extending Content Sources

Developers can add custom content sources:

Content Source Filters

Key filter hooks for content sources:
Content source controls use these REST endpoints:

Performance Considerations

Large queries can impact performance. Consider:
  • Using pagination for post-based content
  • Limiting items per page
  • Enabling caching mechanisms
  • Avoiding complex custom queries when possible

See Also

Portfolio Post Type

Learn about the custom Portfolio post type

Layouts

Choose the right layout for your content

REST API

Query content via REST API

Filters Reference

View all available filter hooks