Skip to content

Instantly share code, notes, and snippets.

@EdwardIII
Created May 18, 2011 15:52
Show Gist options
  • Select an option

  • Save EdwardIII/978857 to your computer and use it in GitHub Desktop.

Select an option

Save EdwardIII/978857 to your computer and use it in GitHub Desktop.
<?php
/*
Template Name: Home
*/
get_header(); ?>
<div id="container">
<div id="content" role="main">
<?php
/* Get the images for the concertina */
$args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID );
$attachments = get_posts($args);
if ($attachments) {
foreach ( $attachments as $attachment ) {
echo apply_filters( 'the_title' , $attachment->post_title );
echo apply_filters( 'the_content' , $attachment->post_excerpt);
the_attachment_link( $attachment->ID , false );
}
}
?>
<?php
/* Get the home content blocks */
$type = 'block';
$args=array(
'post_type' => $type,
'post_status' => 'publish',
'paged' => 0,
'orderby' => 'menu_order',
'order' => 'ASC',
#'posts_per_page' => 2,
#'caller_get_posts'=> 1
);
$temp = $wp_query; // assign orginal query to temp variable for later use
$wp_query = null;
$wp_query = new WP_Query($args);
?>
<?php
/* Run the loop to output the page.
* If you want to overload this in a child theme then include a file
* called loop-page.php and that will be used instead.
*/
get_template_part( 'loop', 'page' );
?>
</div><!-- #content -->
</div><!-- #container -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment