Created
December 4, 2018 03:38
-
-
Save xnau/1a85b839f71b965ca73dbcca57f71adf to your computer and use it in GitHub Desktop.
Example of the use the the PDb_Template class for a Participants Database single record shortcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* template for displaying a business detailed view | |
* | |
* single record template | |
*/ | |
// get the template object for this record | |
$this_business = new PDb_Template($this); | |
?> | |
<h1 class="business-title" | |
<?php $this_business->print_field('business_name') ?> | |
</h1> | |
<div class="wrap <?php echo $this->wrap_class ?>"> | |
<?php if ($this_business->has_content('photo')) : ?> | |
<div class="business-photo"> | |
<?php $this_business->print_field('photo') ?> | |
</div> | |
<?php endif ?> | |
<div class="business-info one-half"> | |
<h3 class="business-address"> | |
<?php $this_business->print_field('address') ?><br /> | |
<?php $this_business->print_field('city') ?>, <?php $this_business->print_field('state') ?><br /> | |
<?php $this_business->print_field('phone') ?><br /> | |
<?php $this_business->print_field('website') ?> | |
</h3> | |
<p class="business-details"> | |
<strong>Category: </strong><?php $this_business->print_field('type_of_business') ?><br /> | |
<strong>Neighborhood: </strong><?php $this_business->print_field('neighborhood') ?><br /> | |
<strong>Years in Business: </strong><?php echo date('Y') - date('Y', $this_business->get_value('year_established')); ?> | |
</p> | |
</div> | |
<?php // show the "More Details" data as a loop | |
echo do_shortcode('[[pdb_single template=loop groups=more_details]]'); ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment