I think that I would hijack the gallery shortcode.
function my_gallery_shortcode($atts) {
global $post;
$str = gallery_shortcode($atts);
$project_title = get_post_meta($post->ID, "Project_Title", true);
$project_date = get_post_meta($post->ID, "Project_Date", true);
$project_location = get_post_meta($post->ID, "Project_Location", true);
$str .= '<div class="project_details">';
$str .= '<div class="project_details_title">'.$project_title.'</div>';
$str .= '<div class="project_details_date">'.$project_date.'</div>';
$str .= '<div class="project_details_location">'.$project_location.'</div>';
$str .= '</div>';
return $str;
}
add_shortcode('gallery','my_gallery_shortcode');
That should work but will print those div
s whether the meta values are set or not so I’d write some conditions to keep things neat– ie. if (!empty($project_title)) {
, etc.– so that you are only printing what you need to be.
You could also just register it with add_shortcode('my_project_gallery','my_gallery_shortcode');
and not take over the default gallery at all.