Last active
May 4, 2020 07:44
-
-
Save conschneider/11f08273ddfd39a2e775 to your computer and use it in GitHub Desktop.
WooCommerce Bookings template for displaying Persons and it's meta info of a booking product
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 Name: Bookings Person types list | |
*/ | |
?> | |
<?php get_header(); ?> | |
<?php | |
//Define your custom post type name in the arguments | |
$args = array('post_type' => 'bookable_person'); | |
//Define the loop based on arguments | |
$loop = new WP_Query( $args ); | |
//Display the contents | |
while ( $loop->have_posts() ) : $loop->the_post(); | |
?> | |
<h1 class="entry-title"><?php the_title(); ?></h1> | |
<div class="entry-content"> | |
<?php the_content(); ?> | |
<?php the_meta(); ?> | |
<h3>Person Cost only</h3> | |
<p>Additional cost per <?php the_title(); ?> is: <?php echo get_post_meta( get_the_ID(), 'cost', true );?></p> | |
</div> | |
<?php endwhile;?> | |
<?php get_sidebar(); ?> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment