• Resolved greigcooke

    (@greigcooke)


    Hi,

    I have created a custom events-list page using the following:

    $events = EM_Events::get( array('scope' => 'future', 'limit' => 2, 'pagination'=> 1,) );?>

    I am outputting the content as follows:

    <?php foreach($events as $EM_Event){
    					$test = $EM_Event->post_id;
    					$pageinfo = get_post( $test ); ?>
    
    				 	 <?php //print_r($EM_Event); ?>
    
    					<div class="twocoloumn">
    						<?php
    						if (has_post_thumbnail($EM_Event->post_id) ){
    						//
    						      $image = get_the_post_thumbnail($EM_Event->post_id, 'thumbnail'); 
    
    							  echo $image;
    						//
    						}
    						?>
    						<h1><?php echo $pageinfo->post_title; ?></h1>
    						<?php $test2 = $EM_Event->post_content; echo nl2br($test2); ?>
    											<p>&nbsp;</p>
    											<div class="read-more"><p><a href="<?php echo get_permalink($test);?>">Read more </a></p><p><img src="<?php echo get_template_directory_uri(); ?>/images/arrow-blue-right.png" width="7px" class="arrow"></p></div>
    											<div style="clear: both;"></div>
    					</div>
    					<?php if ($counter & 1) { // check if odd ?>
    					<div class="two-coloumn-spacer"></div>
    					<?php }?>
    					<?php if ($counter % 2 == 0 ) { //is even ?>
    					<div class="festival-spacer"> </div>
    
    					<?php }?>
    					<?php $counter ++; ?>
    					<?php }?>

    I have muddled my way through and the above works, but I would like to add pagination to the page and I don’t know how.

    Can someone please help?

    Much appreciated

    https://www.ads-software.com/plugins/events-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    maybe you can try something like

    $events = EM_Events::get( array('scope' => 'future', 'limit' => 2) );?>
    
    foreach ($events as $EM_Event){
    
      echo $EM_Event->output('#_EVENTLINK').'<br/>';
    
    }
    Thread Starter greigcooke

    (@greigcooke)

    Hi angelo,

    I can’t see how your code is different from mine as I am using a foreach loop and outputting all data inside of that?

    Plugin Support angelo_nwl

    (@angelo_nwl)

    in your code above you are using wp code to output title and content however in the snippet i shared you can use EM placeholders instead

    eg.

    <a href="<?php echo $EM_Event->output('#_EVENTURL'); ?>">Read More</a>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pagination Links’ is closed to new replies.