Exhibit builder get exhibit by id

get_exhibit_by_id will return the database record for an Exhibit with a given ID.

Usage

<?php get_exhibit_by_id($id); ?>

Parameters

  • $id (integer) - The ID of the exhibit you wish to retrieve. This should be a number matching the ID of an exhibit already existing in your archive.

Example

Using get_exhibit_by_id, you can display metadata for a specific exhibit anywhere in your theme. The following code will set the current exhibit to be the exhibit with an ID of 7, and will then echo the title of that exhibit, wrapped in an h2 tag.

<?php
 
$exhibit = get_exhibit_by_id(7);
 
echo '<h2>'.$exhibit->title.'</h2>';