Support

Home Forums Event Espresso Premium Listing events as "classes" in Fitness Theme

Listing events as "classes" in Fitness Theme

Posted: May 28, 2013 at 11:28 am

Viewing 1 reply thread


Eric Fischer

May 28, 2013 at 11:28 am

Hey folks,

I’m developing a site for a client now (it’s not live yet), and I need a little assistance. The “Fitness” theme they want to use is already set up with a post category called “classes”, that list both on the classes page, and in a widget on the front page. I have already added the shortcode to get EventEspresso’s events tagged “classes” to appear. That was easy.

What I need to know is how can I modify the existing widget to draw from Event Espresso rather than the theme’s “classes” category posts?

The code below is from the page template for the first third display area.

[code language=”php”]<!– Start of home content –>

<div class=”home_content”>

<?php

$featuredport = new WP_Query(‘showposts=1&post_type=class’);

while ($featuredport->have_posts()) : $featuredport->the_post();

?>

 

<img src=”<?php bloginfo(‘template_directory’); ?>/img/classicon.png” height=”27″ width=”21″ alt=”<?php the_title (); ?>” class=”lefthome” />

 

<!– Start of homeclass –>

<div class=”homeclass”>

<a href=”<?php the_permalink (); ?>”><?php the_title (); ?></a>

 

<p><?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,10); ?></p>

 

</div><!– End of homeclass –>

 

<?php

if ( function_exists( ‘get_option_tree’ ) ) {

$homeclassmore = get_option_tree( ‘vn_homclassmore’ );

} ?>

 

<?php if ($homeclassmore != (”)){ ?>

 

<a class=”small” href=”<?php the_permalink (); ?>”><?php echo stripslashes($homeclassmore); ?></a>

 

<?php } else { } ?>

 

<?php endwhile; ?>

 

<?php wp_reset_query(); ?>

 

<hr />

 

</div><!– End of home content –>

 

<!– Start of home content bottom –>

<div class=”home_content_bottom”>

<?php

$featuredport = new WP_Query(‘showposts=1&post_type=class&offset=1’);

while ($featuredport->have_posts()) : $featuredport->the_post();

?>

 

<img src=”<?php bloginfo(‘template_directory’); ?>/img/classicon.png” height=”27″ width=”21″ alt=”<?php the_title (); ?>” class=”lefthome” />

 

<!– Start of homeclass –>

<div class=”homeclass”>

<a href=”<?php the_permalink (); ?>”><?php the_title (); ?></a>

 

<p><?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,10); ?></p>

 

</div><!– End of homeclass –>

 

<?php

if ( function_exists( ‘get_option_tree’ ) ) {

$homeclassmore = get_option_tree( ‘vn_homclassmore’ );

} ?>

 

<?php if ($homeclassmore != (”)){ ?>

 

<a class=”small” href=”<?php the_permalink (); ?>”><?php echo stripslashes($homeclassmore); ?></a>

 

<?php } else { } ?>

 

<?php endwhile; ?>

 

<?php wp_reset_query(); ?>

 

</div><!– End of home content bottom –>

 

</article><!– End of one third first –>[/code]

  • This topic was modified 11 years, 6 months ago by Josh. Reason: not a translation question


Josh

  • Support Staff

May 28, 2013 at 6:27 pm

Hi Eric,

In this case I don’t think you’ll need to modify the theme to make this happen. You can try setting the events to be created as posts (not Event posts) and make sure that they are assigned to the class category. Please see this section of the documentation for more info:

https://eventespresso.com/wiki/add-new-event/#create-post

Viewing 1 reply thread

The support post ‘Listing events as "classes" in Fitness Theme’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso