Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $args = array( 'numberposts' => -1,'category_name' => 'homepage');
- $homePost = get_posts( $args );
- global $more;
- $more = 0;
- $layout = $data['homepage_layout']['enabled'];
- if ( $layout ) :
- foreach ( $layout as $key => $value ) {
- switch ( $key ) {
- case 'block_one' : ?>
- <div class="column">
- <h1 class="tag-background"><span class="background"><?php echo $homePost[1]->post_title; ?></span></h1>
- <img src="<?php bloginfo('template_directory')?>/images/left-image.jpg" alt="image" height="154" width="274" />
- <p><?php echo $homePost[1]->post_excerpt; ?></p>
- <a href="<?php echo $homePost[1]->guid; ?>"><img class="button" src="<?php bloginfo('template_directory')?>/images/read-more.png" alt="read more" height="32" width="85" /></a>
- </div><!--END left-column-->
- <?php break;
- case 'block_two' : ?>
- <div class="column">
- <h1 class="tag-background"><span class="background"><?php echo $homePost[2]->post_title; ?></span></h1>
- <img src="<?php bloginfo('template_directory')?>/images/center-image.jpg" alt="image" height="154" width="274" />
- <p><?php echo $homePost[2]->post_excerpt; ?></p>
- <a href="<?php echo $homePost[2]->guid; ?>"><img class="button" src="<?php bloginfo('template_directory')?>/images/read-more.png" alt="read more" height="32" width="85" /></a>
- </div><!--END center-column-->
- <?php break;
- case 'block_three' : ?>
- <div class="column">
- <h1 class="tag-background"><span class="background"><?php echo $homePost[3]->post_title; ?></span></h1>
- <img src="<?php bloginfo('template_directory')?>/images/right-image.jpg" alt="image" height="154" width="274" />
- <p><?php echo $homePost[3]->post_excerpt; ?></p>
- <a href="<?php echo $homePost[3]->guid; ?>"><img class="button" src="<?php bloginfo('template_directory')?>/images/read-more.png" alt="read more" height="32" width="85" /></a>
- </div><!--END right-column-->
- <?php break;
- case 'welcome-message' : ?>
- <div class="two-thirds">
- <h1 class="tag-background"><span class="background"><?php echo $homePost[0]->post_title; ?></span></h1>
- <p><?php echo $homePost[0]->post_excerpt; ?></p>
- <span class="read-more"><a href="<?php echo $homePost[0]->guid; ?>">Read More →</a></span>
- </div><!--END two-thirds-->
- <?php break;
- case 'latest-news' : ?>
- <div class="one-third">
- <h1 class="tag-background"><span class="background"><?php the_category(); ?></span></h1>
- <div id="latest-news">
- <ul>
- <?php $custom_query = new WP_Query(array( 'category_name' => 'recent-news' ));
- while($custom_query->have_posts()) : $custom_query->the_post(); ?>
- <li><?php echo get_the_post_thumbnail(); ?>
- <span class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
- <span class="date"><?php the_date(); ?></span></li>
- <?php endwhile; ?>
- <?php wp_reset_postdata(); // reset the query ?>
- </ul>
- </div><!--END latest-news-->
- </div><!--END one-third-->
- <?php break;
- case 'line-break': ?>
- <div class="clear"></div><hr />
- <?php break;
- }
- }
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement