function locations() { global $post; $query = new WP_Query("post_type=page&posts_per_page=6&post_parent={$post->ID}"); if ($query->have_posts()) { echo '<ul class="locations">'; while ($query->have_posts()) { $query->the_post(); ?> <li style="<?php thumbnail_bg('ver-1'); ?> " class="item"> <a href="<?php the_permalink(); ?> "><p class="title"><?php the_title(); ?> </p></a> </li><?php } echo '</ul>'; } wp_reset_postdata(); }
<section class="div"> <div class="wrap"> <h2 class="heading"><?php the_sub_field('title'); ?> </h2> <ul class="features"> <?php $query = new WP_Query('posts_per_page=4'); ?> <?php while ($query->have_posts()) { $query->the_post(); ?> <li style="<?php thumbnail_bg('ver-1'); ?> " class="item"> <a href="<?php the_permalink(); ?> "> <div class="body"> <h3 class="title"><?php the_title(); ?> </h3> <?php excerpt(); ?> </div>
<div style="<?php thumbnail_bg('hor-2'); ?> " class="item"> <a href="<?php the_permalink(); ?> "> <div class="body"> <h2 class="title"><?php the_title(); ?> </h2> <time class="date"><?php the_time('d/m/Y'); ?> </time> <?php the_excerpt(); ?> <div class="button alt"> <?php _e('More', 'atins'); ?> <i class="caret"></i> </div> </div> </a> </div>