Skip to content

Instantly share code, notes, and snippets.

@tenman
Created December 16, 2013 00:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenman/7980444 to your computer and use it in GitHub Desktop.
Save tenman/7980444 to your computer and use it in GitHub Desktop.
Grid posts template for WordPress theme Raindrops
<?php
/**
* Template Name: Grid Post
*
*
*/
if ( ! defined( 'ABSPATH' ) ) { exit; }
do_action( 'raindrops_'. basename(__FILE__) );
$raindrops_current_column = raindrops_show_one_column( );
if ( $raindrops_current_column !== false ) {
add_filter( "raindrops_theme_settings__raindrops_indv_css", "raindrops_color_type_custom" );
}
get_header( $raindrops_document_type );
do_action( 'raindrops_pre_'.basename( __FILE__) );
raindrops_debug_navitation( __FILE__ );
?>
<div id="yui-main">
<div class="yui-b <?php raindrops_add_class( 'yui-b' ); ?>">
<div class="<?php echo raindrops_yui_class_modify( );?>" id="container">
<div class="yui-u first<?php raindrops_add_class( 'yui-u first', true );?>">
<?php
/** raindrops_tile( )
*
*
*
*
*/
$args = array(
'posts_per_page' => 12,
'numberposts' => -1,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'meta_key' => '_thumbnail_id', //Shows only has post thumbnail
'post_status' => 'publish',
'post__not_in' => get_option( 'sticky_posts' ),
'raindrops_tile_col' => 4,//columns 2-4
);
raindrops_tile( $args );
?>
</div>
<?php
if ( 3 == raindrops_show_one_column( ) ) {
?>
<div class="yui-u">
<?php
raindrops_prepend_extra_sidebar( );
get_sidebar( 'extra' );
raindrops_append_extra_sidebar( );
?>
</div>
<?php
} elseif ( $rsidebar_show && false == $raindrops_current_column ) {
?>
<div class="yui-u">
<?php
raindrops_prepend_extra_sidebar( );
get_sidebar( 'extra' );
raindrops_append_extra_sidebar( );
?>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php
if ( raindrops_show_one_column( ) !== '1' || false == $raindrops_current_column ) {
?>
<div class="yui-b">
<?php //lsidebar start
raindrops_prepend_default_sidebar( );
get_sidebar( 'default' );
raindrops_append_default_sidebar( );
?>
</div>
<?php
}
?>
</div>
<?php get_footer( $raindrops_document_type ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment