Last active
January 19, 2016 21:28
-
-
Save bethf/13ef13dff9c7957aefa7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This file adds the solds template to the Brandt Real Estate Child Theme. | |
*/ | |
/* | |
Template Name: Featured solds | |
*/ | |
#add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); | |
$args = array( | |
'posts_per_page' => 18, | |
'offset' => 0, | |
'category' => 9, | |
'orderby' => 'post_date', | |
'order' => 'DESC', | |
'include' => '', | |
'exclude' => '', | |
'meta_key' => '', | |
'meta_value' => '', | |
'post_type' => 'post', | |
'post_mime_type' => '', | |
'post_parent' => '', | |
'post_status' => 'publish', | |
'paged' => 'paged', | |
'suppress_filters' => true ); | |
$sold = get_posts( $args ); | |
get_header(); | |
?> | |
<?php genesis_before_content_sidebar_wrap(); ?> | |
<div id="content-sidebar-wrap"> | |
<?php genesis_before_content(); ?> | |
<div id="content" class="hfeed"> | |
<?php genesis_before_loop(); ?> | |
<?php // genesis_loop() below; ?> | |
<?php if (have_posts()) : while (have_posts()) : the_post(); // the loop ?> | |
<?php genesis_before_post(); ?> | |
<div class="page type-page"> | |
<?php genesis_before_post_title(); ?> | |
<h1 class="entry-title"></h1> | |
<h2><?php echo $post->post_title; ?></h2> | |
<div class="entry-content"><?php genesis_do_post_content(); ?></div> | |
<!-- solds --> | |
<?php $cnt = 0; ?> | |
<?php foreach ($sold as $sold) { ?> | |
<?php $cnt = $cnt+1; ?> | |
<?php $class = ''; ?> | |
<?php if ( $cnt % 3 === 1 ) $class = 'sold first'; ?> | |
<div class="one-third <?php echo $class; ?>"> | |
<?php if (has_post_thumbnail($sold->ID) ) { ?> | |
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id($sold->ID), 'single-post-thumbnail' ); ?> | |
<img src="<?php echo $image[0]; ?>" alt="<?php echo $sold->post_title; ?>" class="alignleft" style="border:1px solid #000; margin-bottom:4px;" /> | |
<?php }; ?> | |
<!--<h3><?php echo $sold->post_title; ?></h3>--> | |
<?php echo apply_filters( 'the_content', $sold->post_content ); ?> | |
</div> | |
<?php } ?> | |
</div><!-- end .postclass --> | |
<?php genesis_after_post(); ?> | |
<?php endwhile; // end of one post ?> | |
<?php genesis_numeric_posts_nav(); ?> | |
<?php else : // if no posts exist ?> | |
<?php genesis_loop_else(); ?> | |
<?php endif; // end loop ?> | |
<?php genesis_after_loop(); ?> | |
</div><!-- end #content --> | |
<?php genesis_after_content(); ?> | |
</div><!-- end #content-sidebar-wrap --> | |
<?php genesis_after_content_sidebar_wrap(); ?> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment