• Resolved Ibby

    (@ibby)


    Hi,

    I’m trying to create an ‘Upcoming meetings page’ using a post loop but I’m not able to pull the data that I want into it. For instance, I want to be able to show the meeting time and date and order the meetings by their start dates.

    Is this possible?
    If I add:
    <span class="sidebar-start-time"><?php echo date( 'F j, Y @ g:i a', strtotime( $zoom['start_date'] ) ); ?></span>

    To my loop, it is returning 01/01/1970 (I assume because I need to include some script to pull the correct time/date?).

    This is my complete loop code so far:

    <?php
    /**
     * Loop Name: Online Classes
     *
     * @package siteorigin-unwind
     * @since siteorigin-unwind 0.9
     * @license GPL 2.0
     */
    ?>
    
    <?php
    if ( have_posts() ) :
    
    	if ( is_home() && ! is_front_page() ) : ?>
    		<header>
    			<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
    		</header>
    	<?php endif; ?>
    
    	<div class="left-medium-loop">
    
    	<?php
    	/* Start the Loop */
    	while ( have_posts() ) : the_post(); ?>
    
    		<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    			<?php if ( has_post_thumbnail() ) : ?>
    				<div class="entry-thumbnail">
    					<a href="<?php the_permalink(); ?>">
    						<?php if ( has_post_thumbnail() ) : ?>
    							<?php the_post_thumbnail( '360x238-crop' ); ?>
    						<?php endif; ?>
    					</a>
    				</div>
    			<?php endif; ?>
    
    			<div class="entry-content">
    				<header class="entry-header">
    					<?php if ( 'post' === get_post_type() ) : ?>
    						<div class="entry-meta">
    							<?php siteorigin_unwind_post_meta(); ?>
    						</div><!-- .entry-meta -->
    					<?php
    					endif; ?>
    
    					<?php the_title( sprintf( '<h3 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' ); ?>
    				</header><!-- .entry-header -->
    
    				<div class="entry-summary">
    					<span class="sidebar-start-time"><?php echo date( 'F j, Y @ g:i a', strtotime( $zoom['start_date'] ) ); ?></span>
    					<?php siteorigin_unwind_excerpt(); ?>
    				</div><!-- .entry-summary -->
    			</div>
    
    		</article><!-- #post-## -->
    
    	<?php endwhile; ?>
    
    	</div><!-- .left-medium-loop -->
    
    	<?php siteorigin_unwind_posts_navigation();
    
    else :
    
    	get_template_part( 'template-parts/content', 'none' );
    
    endif; ?>
  • The topic ‘Upcoming meetings post loop’ is closed to new replies.