Forums Forums Search & Filter Pro Custom Query and template

Viewing 3 posts - 1 through 3 (of 3 total)
  • Anonymous
    #84202

    Hi,

    Just bought and read the docs but i’m not following here.

    This is a piece from one template file in my theme:

    <section id="events-lijst">
    
        <?php
          // the query
        $options = array(
        'post_type' => 'event',
        'posts_per_page' => 20,
        'order' => 'ASC',
        'meta_key'		=> 'taal',
    	  'meta_value'	=> 'Nederlands'
        );
        $query = new WP_Query( $options );
        ?>
    
        <?php if ( $query->have_posts() ) : ?>
    
        <div class="container">
          <div class="eventrow">
      	     <?php while ( $query->have_posts() ) : $query->the_post(); ?>
    
               <div class="panel panel-default">
               		<div class="panel-heading">
                    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                  </div>
                  <div class="event-foto-sectie">
                    <?php $uitgelichte_afbeelding = get_field( 'uitgelichte_afbeelding' ); ?>
                    <?php if ( $uitgelichte_afbeelding ) { ?>
                    <a href="<?php the_permalink(); ?>"><img src="<?php echo $uitgelichte_afbeelding['url']; ?>" class="event-featured-img" alt="<?php echo $uitgelichte_afbeelding['alt']; ?>" /></a>
                    <?php } ?>
                  </div>
               		<div class="panel-body">
                    <?php
                    $dateformatstring = "l d F, Y";
                    $unixtimestamp = strtotime(get_field('datum'));
                    ?>
                    <p><strong>Datum: </strong> <?php echo date_i18n($dateformatstring, $unixtimestamp); ?><br/><strong>Locatie: </strong><?php the_field( 'locatie' ); ?></p>
                    <span class="eventuitleg"><?php the_excerpt(); ?></span>
                    <p class="bekijkevent"><strong><a href="<?php the_permalink(); ?>">Bekijk dit evenement</a> >></strong></p>
                  </div>
               	</div>
    
             <?php endwhile; ?>
    
          </div>
    
        </div>
    
      	<?php wp_reset_postdata(); ?>
    
      <?php else : ?>
        <section class="section-padding">
        <div class="container">
          <div class="row-centered">
            <div class="col-md-12 col-centered">
                <strong>Sorry, geen enkel event geprogrammeerd op dit ogenblik...</strong>
            </div>
          </div>
        </div>
        </section>
      <?php endif; ?>
    
    </section><!-- event lijst -->

    I want to put a row at the top where my query underneath is filterd on custom fields (using ACF)

    Anonymous
    #84243
    This reply has been marked as private.
    Trevor
    #84276
    This reply has been marked as private.
Viewing 3 posts - 1 through 3 (of 3 total)