• Resolved binyanim

    (@binyanim)


    Hi.
    I am already knee deep in this code, but still I don’t know how it works or why…
    I can loop through my custom pod and I’m getting different fields but the same title (the newest one) .

    
        $meta = get_post_meta(get_the_ID(), '', true);
        $mypod = pods( 'event'); 
    	$mypod->find(array( 
    	        'orderby' => 'event_date DESC',
    	        'limit' => '10')
    	);	?>
    
    <div id="main-content">
    	<div class="container">
    		<div id="content-area" class="clearfix">
      <?php 
    
    while ( $mypod->fetch() ) : 
    
                global $post;
                $meta = get_post_meta(get_the_ID(), '', true);
                $event_date =  $mypod->field( 'event_date' );
                $title = $mypod->field('title');
                $pic = $mypod->field('header_image');
                $headerurl = pods_image_url( $pic, 'medium');
                $signuplink = $mypod->field('signup_link');
                $event_desc = $mypod->field('event_description');
              	$event_loc = $mypod->field('event_loc');
              	$title_color = $mypod->field('title_color'); ?>
    
    	<div class="single-event">
    		<h1><?php echo the_title() ?> </h1>
    			<?php echo $event_date; ?> </br>
    	 		<?php echo $signuplink; ?> </br>
    	 		<?php echo $event_loc;  ?> </br>
    	 		<img src="<?php echo $headerurl ?>">
    		</div>
    
               <?php endwhile; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Getting only the last title in loop’ is closed to new replies.