custom events page without echoing the_content()
-
I want to make a custom event template without echoing
the_content();
/ CONTENTS shortcode.I have this bit of code on my
page.php
if ( is_page('events') ){ include( TEMPLATEPATH .'/includes/events.php' );
and on my
includes/events.php
file this is my code<div class="featured-event clearfix"> <h1>Featured event</h1> <?php $args = array('order' => 'DESC','limit' => 1,'category' =>'12','scope'=>'future, past'); $EM_Events = EM_Events::get($args); foreach ( $EM_Events as $EM_Event): ?> <div class="featured-image"><?php echo $EM_Event->output('#_EVENTIMAGE'); ?></div> <article> <h4><?php echo $EM_Event->output('#_EVENTDATES'); ?></h4> <h4><?php echo $EM_Event->output('#_EVENTTIMES'); ?></h4> <h4><?php echo $EM_Event->output('#_LOCATIONADDRESS'); ?></h4> <h4><?php echo $EM_Event->output('#_ATT{Sign up}{No sign up required|Sign up required}'); ?></h4> <h4><?php echo $EM_Event->output('#_ATT{Cost}{FREE}'); ?></h4> <?php echo $EM_Event->output('#_EVENTNOTES'); ?> </article> <button><a href="<?php echo $EM_Event->output('#_EVENTURL'); ?>">Sign up</a></button> <?php endforeach; ?> </div> <!-- end .featured-event --> <?php if (class_exists('EM_Events')) { echo EM_Events::output( array('order' => 'DESC','scope'=>'past, future','pagination'=>1,'limit'=>'6') ); } ?>
I also have a
single-event.php
file with this bit of code<?php get_header();?> <section class="main clearfix"> <div class="event-detailed clearfix"> <?php global $EM_Event; echo $EM_Event->output_single(); ?> </section> <?php get_footer();?>
I formatted the Default event list format and Single Event Page in WP Events Manager Admin settings and have set Display events as – Posts.
If I don’t put a post loop on my
page.php
file then the permalink is broken for my-booking, location, categories, tags sub pages and I also want to show Events Manager Search function.
e.g. no<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <?php the_content(); ?> <?php>
Can I not use the shortcode CONTENTS and make a custom events page
I’ve read through these documentations but I find them difficult to understand and not sure if it is doing what I want to achieve.
– https://wp-events-plugin.com/tutorials/create-custom-event-information-pages/
– https://wp-events-plugin.com/tutorials/overriding-event-page-content-with-filters/
– https://wp-events-plugin.com/documentation/using-template-files/
- The topic ‘custom events page without echoing the_content()’ is closed to new replies.