Display featured Exhibit

Hi,

I am using the latest plugin Exhibit Builder 3.3.3 and I would like to display a feature exhibit on the home page, index.php but I would like to change the order of the Title and text displayed on the image.

I am calling this function from the index.php but I see the style is created in the single.php

I tried to create a single.php file under exhibit_builder/exhibits in my theme. but still it is calling the single.php in the plugin.

I am loong for doc to explain more but no luck so far.

function exhibit_builder_display_random_featured_exhibit()
{
$html = ‘

’;
$featuredExhibit = exhibit_builder_random_featured_exhibit();
$html .= ‘

’ . __(‘Featured Exhibit’) . ‘

’;
if ($featuredExhibit) {
$html .= get_view()->partial(‘exhibits/single.php’, array(‘exhibit’ => $featuredExhibit));
} else {
$html .= ‘

’ . __(‘You have no featured exhibits.’) . ‘

’;
}
$html .= ‘
’;
$html = apply_filters(‘exhibit_builder_display_random_featured_exhibit’, $html);
return $html;
}

I’m pretty sure that what’s happening here is that your single.php file isn’t being read on the front page because it’s not a view from ExhibitBuilder. Thus, the redirecting to your copy of single.php doesn’t get read from the front page. (It should, however, be read from the exhibits browse page.

To make it work as you’d like, but the single.php file in the theme’s common folder, probably renaming it to something like exhibit-single.php. Then, just in the function you use for the front page, make the partial use that file: common/exhibit-single.php.

Hi Patrick,

Thanks for the help. I was able to solve the problem by adding the single.php file into my exhibit in my theme and use this function to call it. I believe the complete path is necessary to make it seen

get_view()->partial(‘exhibit-builder/exhibits/single.php’, array(‘exhibit’ => $featuredExhibit));

Nancy

This topic was automatically closed after 250 days. New replies are no longer allowed.