CI HU Connector for Wordpress: Display Asset Metadata Using Shortcodes
The CI HUB Connector allows you to display asset metadata in WordPress using the CI HUB metadata shortcode. This feature also works with the CI HUB Connector for WordPress.
To display metadata, you only need the attachment ID (Post ID) of the asset and the metadata field name you want to show. Custom field names can be found in the asset details view within the WordPress Media Library.

Find the Post ID of an Asset
To locate the Post ID:
-
Open the WordPress Media Library.
-
Switch to the Detail View of the asset.
-
Look at the URL of the asset page.
-
The number shown in the URL is the Post ID.
This ID will be used in the shortcode to reference the asset.

Create the Metadata Shortcode
After placing an asset on a page, you can display its metadata using the cihub_metadata shortcode.
The basic shortcode format is:
[cihub_metadata]
Step 1 — Add the Asset ID
Insert the Post ID of your asset:
[cihub_metadata id="42"]
Step 2 — Add the Metadata Field
Specify the metadata key (field name) you want to display. For example, to display the asset name:
[cihub_metadata id="42" key="name"]
WordPress will now display the value of that metadata field.

Advanced Example
You can also create more advanced shortcodes that include additional text and multiple metadata values.
Example:
[cihub_metadata id="42" key="name" content="false"]
Hello, the asset name is: {metadata} and it was created: {metadata.created}.
[/cihub_metadata]
This allows you to embed metadata dynamically within your page content.
Additional Information
For more details on available shortcode options and actions, refer to the CI HUB Connector plugin page in the WordPress Plugin Directory.