• Skip to main content

Julian Thomas Screawn

B.A. ,B.ED. ,M.ED.

  • Home
  • About
  • Websites
  • Resources
  • Coding
  • Contact

LearnPress Custom Template

2025/12/25

<?php 
/*****************************
* Template Name: List in-person courses 
*****************************/

// Add our custom loop


remove_action ('genesis_loop', 'genesis_do_loop'); 
add_action( 'genesis_loop', 'custom_do_loop' ); 


function custom_do_loop() { 

global $post;
global $wp_query;?>

<header class="entry-header"><h1 class="entry-title" itemprop="headline">In-Person Courses</h1></header>
<div style="text-align:center;" class="entry-content" itemprop="text">
<?php $args = array(
'post_type' => 'lp_course',
'posts_per_page' => -1
);

$courses = new WP_Query( $args );


//145 89 _lp_deliver_type  in_person_class

if ( $courses->have_posts() ){
while ( $courses->have_posts() ) : $courses->the_post(); 

$delivery = get_post_meta($post->ID,'_lp_deliver_type',true); 
$featured= get_post_meta($post->ID,'_lp_featured',true); 


if($delivery=="in_person_class"){ ?>
<div class="card">
<?php $course_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID)); ?>
<img class="card-img-top" src="<?php echo $course_image; ?>" alt="Card image cap">
  <div class="card-body">
    <h5 class="card-title"><?php echo get_the_title();?></h5>
    <p class="card-text"><?php the_content();?></p>
    <a href="<?php echo get_the_guid(); ?>" class="button">Join</a>
  </div>
</div>
<?php }
else{
if($delivery!="private_1_1" and $delivery!="live_class"){	
echo "<p>Currently there are no in person courses listed.</p>";
}
}
 endwhile; ?>
</div>
<?php wp_reset_postdata();
}	 
else {
   
   echo "no courses";
?>
<?php
   }
?>



<?php } //loop

genesis();

Filed Under: LearnPress, Wordpress

Copyright © 2025 · Servicing Moncton, Dieppe, Riverview and beyond! · Moncton Meditation ·