Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $args = array(
- 'post_type'=> 'forsale',
- 'p' => '12,16',
- 'orderby' => 'ID',
- 'post_status' => 'publish',
- 'order' => 'DESC',
- 'posts_per_page' => -1 // this will retrive all the post that is published
- );
- $result = new WP_Query( $args );
- if ( $result-> have_posts() ) : ?>
- <table class="container">
- <?php while ( $result->have_posts() ) : $result->the_post(); ?>
- <thead><tr><th><?php the_title(); ?></th></tr></thead>
- <tbody>
- <tr><td>Price</td><td><?php echo get_post_meta( get_the_ID(), 'price' ); ?></td><tr>
- <tr><td>Bed</td><td><?php get_post_meta( get_the_ID(), 'bed' ); ?></td><tr>
- </tbody>
- <?php endwhile; ?>
- </table>
- <?php endif;
- wp_reset_postdata(); ?>
Add Comment
Please, Sign In to add comment