Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Single Rooms Template
- *
- * Front Page.
- */
- get_header(); ?>
- <?php
- global $post;
- $slug = get_post( $post )->post_name; /*sets the SLUG Variable, which will be matched with the attachment's meta*/
- $args = array( 'post_type' => 'attachment', 'posts_per_page' => 10 );
- $loop = new WP_Query( $args );
- ?>
- <h1>PAGE NAME = <?php echo $slug; ?></h1>
- <div id="primary" class="content-area">
- <div id="content" class="site-content" role="main">
- <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
- <?php
- $room = get_post_meta($post->ID, '_room', true);
- if ($room == $slug) {
- echo '<img src="'the_thumbnail('Large List')'" />'
- }
- ?>
- <?php endwhile; /* end of the loop.*/ ?>
- </div><!-- #content -->
- </div><!-- #primary -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement