Last active
August 29, 2015 14:10
-
-
Save aristath/c4e24dd2a077cc927a20 to your computer and use it in GitHub Desktop.
See http://premium.wpmudev.org/forums/topic/i-want-to-have-a-grid-display-for-the-blog-on-my-website?replies=39#post-781296 for details
This file contains 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 | |
$ads = array( | |
1 => '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> | |
<ins class="adsbygoogle" | |
style="display:inline-block;width:300px;height:250px" | |
data-ad-client="ca-pub-5228026630530124" | |
data-ad-slot="2078322417"></ins> | |
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>', | |
4 => '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> | |
<ins class="adsbygoogle" | |
style="display:inline-block;width:300px;height:250px" | |
data-ad-client="ca-pub-5228026630530124" | |
data-ad-slot="2078322417"></ins> | |
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>', | |
); | |
?> | |
<?php if ( ! have_posts() ) : ?> | |
<div id="post-0" class="post not-found post-listing"> | |
<h2 class="post-title"><?php _e( 'Not Found', 'tie' ); ?></h2> | |
<div class="entry"> | |
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'tie' ); ?></p> | |
<?php get_search_form(); ?> | |
</div> | |
</div> | |
<?php else : ?> | |
<div class="post-listing"> | |
<?php $i = 0; ?> | |
<?php $ad_locations = array( 1, 4 ); ?> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<?php $i++; ?> | |
<?php foreach ( $ads as $ad_position => $ad_code ) : ?> | |
<?php if ( $i == $ad_position ) : ?> | |
<article <?php tie_post_class('item-list'); ?>> | |
<?php echo $ad_code; ?> | |
</article> | |
<?php endif; ?> | |
<?php endforeach; ?> | |
<?php if( tie_get_option( 'blog_display' ) != 'full_thumb' ): ?> | |
<article <?php tie_post_class('item-list'); ?>> | |
<h2 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> | |
<?php get_template_part( 'includes/archives-meta' ); ?> | |
<?php if( tie_get_option( 'blog_display' ) == 'content' ): ?> | |
<div class="entry"> | |
<?php the_content( __( 'Read More »', 'tie' ) ); ?> | |
</div> | |
<?php else: ?> | |
<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?> | |
<div class="post-thumbnail"> | |
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"> | |
<?php the_post_thumbnail('thumbnail'); ?> | |
<span class="overlay-icon"></span> | |
</a> | |
</div><!-- post-thumbnail /--> | |
<?php endif; ?> | |
<div class="entry"> | |
<p> | |
<?php tie_excerpt() ?> | |
<a class="more-link" href="<?php the_permalink() ?>"><?php _e( 'Read More »', 'tie' ) ?></a> | |
</p> | |
</div> | |
<?php endif; ?> | |
<?php if ( tie_get_option( 'archives_socail' ) ) : ?> | |
<?php get_template_part( 'includes/post-share' ); ?> | |
<?php endif; ?> | |
<div class="clear"></div> | |
</article><!-- .item-list --> | |
<?php else: ?> | |
<article <?php tie_post_class('item-list'); ?>> | |
<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?> | |
<div class="post-thumbnail single-post-thumb archive-wide-thumb"> | |
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php tie_thumb( 'slider' ); ?><span class="overlay-icon"></span></a> | |
</div> | |
<div class="clear"></div> | |
<?php endif; ?> | |
<h2 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> | |
<?php get_template_part( 'includes/archives-meta' ); ?> | |
<div class="entry"> | |
<p> | |
<?php tie_excerpt() ?> | |
<a class="more-link" href="<?php the_permalink() ?>"><?php _e( 'Read More »', 'tie' ) ?></a> | |
</p> | |
</div> | |
<?php if ( tie_get_option( 'archives_socail' ) ) : ?> | |
<?php get_template_part( 'includes/post-share' ); ?> | |
<?php endif; ?> | |
<div class="clear"></div> | |
</article><!-- .item-list --> | |
<?php endif; ?> | |
<?php endwhile;?> | |
</div> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment