WordPress.org

Forums

Events Manager
[resolved] using event format settings on a custom event list (3 posts)

  1. darksigns
    Member
    Posted 1 year ago #

    hi,
    I would like to use the default events list format (which can be edited in the settings >> formatting >> events) in my custom list. how can I do it? I simply put the events_list.php in, but it doesn' work.
    here is my custom list page widt two columns:

    <?php
    $args = array(	'post_type' => 'event',
    				'posts_per_page' => 10,
    				'meta_query' => array(
    					array( 'key' => '_start_ts', 'value' => current_time('timestamp'), 'compare' => '>=', 'type'=>'numeric' )),
    				'orderby' => 'event_start_date',
    				'order' => 'DESC'
     				 );
    $loop = new WP_Query( $args );?>
    <?php $num_cols = 2; // set the number of columns here
    for ( $i=1 ; $i <= $num_cols; $i++ ) :
    echo '<div id="col-' . $i . '" class="col" >';
    $counter = $num_cols + 1 - $i; ?>
    	<?php while ( $loop->have_posts() ) : $loop->the_post();
    		if( $counter%$num_cols == 0 ) :
    		// begin of core posts output ?>
    		<?php include_once 'plugins/events-manager/templates/events-list.php;?>
        <?php endif; $counter++; endwhile;?>
    		<?php rewind_posts();
    echo'</div>'; endfor; ?>
        <?php if (  $wp_query->max_num_pages > 1 ) : ?>
    	<div id="nav-below" class="navigation">
    		<?php if(function_exists('page_navi')) { page_navi(); } else { ?>
    		<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
    		<?php } ?>
            </div><!-- #nav-below -->
    	<?php endif;?>
    <?php wp_reset_query(); ?>

    I also tried to put the table from the events-manager format settings:

    <table  class="eventtable" width="400"cellpadding="5px" cellspacing="5" class="post" ><tr>
        <td  class="eventimage" rowspan="3" width="100">#_EVENTIMAGE{100,100}</td>
        <td class="eventname"> #_EVENTLINK</td>
      </tr>
      <tr>
        <td class="eventexp">#_EVENTEXCERPT</td>
      </tr>
      <tr>
        <td class="eventdate"><table width="100%" border="0" cellpadding="5px">
            <tr>
              <td class="leftcol"><span class="eventplace">#_LOCATIONNAME</span><br>#_EVENTDATES</td>
              <td class="rightcol"></td>
            </tr>
        </table></td>
      </tr>
    </table>

    but instead the data just the #_x placeholder is there.:(
    http://wordpress.org/extend/plugins/events-manager/

  2. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    Where are you putting this code?

  3. angelo
    NetWebLogic Support
    Posted 1 year ago #

    you need to call EM_Events::output so it will convert EM placeholders - http://wp-events-plugin.com/documentation/advanced-usage/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic