Use code from templates in page.php
-
How can I use the code from the EM templates in page.php? Using the following code:
$techs = new WP_User_Query( $args ); foreach($techs->results as $tech) : setup_postdata( $post ); endforeach; foreach($events as $event ) : setup_postdata( $post ); endforeach; $previous_course_date = ""; foreach ( $events as $event ) { $current_course_date = $event->event_start_date; if ($current_course_date != $previous_course_date) { ?> <h5><strong><?php echo $event->event_start_date . " to " . $event->event_end_date; ?></strong></h5> <?php } // COMPLETE CODE COPIED STRAIGHT FROM attendeelist.php } wp_reset_postdata();
results in the following error:
“Fatal error: Call to a member function get_bookings() on a non-object in \wp-content\themes\test\page-techs.php on line 71”
Does anyone have any ideas? If I use
echo $event->output('#_ATTENDEESLIST');
It works, but I need to customize it, and would prefer to use the code from the template directly in page.php than edit copy of attendeelist.php template
Thanks in advance!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Use code from templates in page.php’ is closed to new replies.