Skip to content

Instantly share code, notes, and snippets.

Created January 4, 2013 05:30
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 anonymous/4450181 to your computer and use it in GitHub Desktop.
Save anonymous/4450181 to your computer and use it in GitHub Desktop.
<?
$css = array('path_to_css_file', 'http://www.tv-cafe.com/wp-content/themes/tvcafe/posttypecss/style-pll.css');
require_once('header.php'); // aka the top
?>
<div id="content">
//This code is the beginning to placing advertisemnt in between post **ad code**
<?php $counter = 0; ?>
//This code is so that the post will be in columns
<?php $count = 0; ?>
<?php $excludes = array();
$args=array(
'post_type' => array ('gallery','videos'),
'taxonomy'=>'series',
'term' => 'pretty-little-liars',
'post_status' => 'publish',
);
$my_query = new WP_Query( $args );
if ($my_query->have_posts()) :
while($my_query->have_posts()) :
$my_query->the_post();
endwhile;
endif;
wp_reset_postdata();
/* The 2nd Query (without global var) */
$query2 = new WP_Query( $args2 );
// The 2nd Loop
if ($query2->have_posts()) :
while($query2->have_posts()) :
$query2->the_post();
endwhile;
endif;
wp_reset_postdata(); ?>
//Ad Code
<?php $counter = $counter + 1;?>
//Column code
<?php $count++; ?>
//Column code first post
<?php if ($count <= 1) : ?>
<div class="entry5">
<div class="entry-content clearfix">
<div class= "entry-list-thumb4">
<a href="<?php the_permalink(); ?>" title="<?php printf(__( 'Read %s', 'wpbx' ), wp_specialchars(get_the_title(), 1)) ?>">
<?php the_post_thumbnail('top-post'); ?>
</a>
</div>
<div class="entry-content5">
<div class="entry-top">
<h2 class="entry-title5"><a href="<?php the_permalink() ?>" title="<?php printf( __('Permalink to %s', 'wpbx'), the_title_attribute('echo=0') ) ?>" rel="bookmark"><?php the_title() ?></a></h2>
<div class="entry-meta-top">
<span class="entry-date"><font color="#999999"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></font></span>
</div>
</div>
<?php $text = $post->post_excerpt;
if (strlen($text) > 380) {
$text = substr($text,0,strpos($text,' ',380)); } ;
$text = $text . ' ...';
echo apply_filters('the_excerpt',$text); ?>
</div>
</div>
<div class="entry-meta entry-bottom2">
</div>
//Column code second and third post
<?php elseif ($count <= 3) : ?>
<div class="entry">
<div class="entry-content clearfix">
<div class="type"><a href="<?php echo get_post_type( $post->ID ); ?>"><?php $post_type = get_post_type_object( get_post_type($post) ); echo $post_type->label ; ?></a></div>
<div class= "entry-list-thumb">
<a href="<?php the_permalink(); ?>" title="<?php printf(__( 'Read %s', 'wpbx' ), wp_specialchars(get_the_title(), 1)) ?>">
<?php the_post_thumbnail(); ?>
</a>
</div>
</div>
<div class="entry-top">
<h2 class="entry-title4"><a href="<?php the_permalink() ?>" title="<?php printf( __('Permalink to %s', 'wpbx'), the_title_attribute('echo=0') ) ?>" rel="bookmark"><?php the_title() ?></a></h2>
<div class="entry-meta-top">
<span class="entry-date"><font color="#999999"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></font></span>
</div>
</div>
<div class="entry-meta entry-bottom2">
</div>
//Column code post four - seven
<?php elseif ($count <= 7) : ?>
<div class="entry4">
<div class="entry-content clearfix">
<div class="type"><a href="<?php echo get_post_type( $post->ID ); ?>"><?php $post_type = get_post_type_object( get_post_type($post) ); echo $post_type->label ; ?></a></div>
<div class="entry-top">
<h2 class="entry-title4"><a href="<?php the_permalink() ?>" title="<?php printf( __('Permalink to %s', 'wpbx'), the_title_attribute('echo=0') ) ?>" rel="bookmark"><?php the_title() ?></a></h2>
<div class="entry-meta-top">
<span class="entry-date"><font color="#999999"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></font></span>
</div>
</div>
</div>
<div class="entry-meta entry-bottom2">
</div>
//Column code post post eigth through 13
<?php elseif ($count <= 13) : ?>
<div class="entry3">
<div class="entry-content clearfix">
<div class= "entry-list-thumb3">
<a href="<?php the_permalink(); ?>" title="<?php printf(__( 'Read %s', 'wpbx' ), wp_specialchars(get_the_title(), 1)) ?>">
<?php the_post_thumbnail('third-post'); ?>
</a>
</div>
<div class="entry-top">
<div class="type2"><a href="<?php echo get_post_type( $post->ID ); ?>"><?php $post_type = get_post_type_object( get_post_type($post) ); echo $post_type->label ; ?></a></div>
<h2 class="entry-title4"><a href="<?php the_permalink() ?>" title="<?php printf( __('Permalink to %s', 'wpbx'), the_title_attribute('echo=0') ) ?>" rel="bookmark"><?php the_title() ?></a></h2>
<div class="entry-meta-top">
<span class="entry-date"><font color="#999999"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></b></font></span>
<br>
</div>
</div>
</div>
<div class="entry-meta entry-bottom2">
</div>
//Column code post fourteen - sixteen
<?php elseif ($count <= 16) : ?>
<div class="entry6">
<div class="entry-content clearfix">
<div class="type"><a href="<?php echo get_post_type( $post->ID ); ?>"><?php $post_type = get_post_type_object( get_post_type($post) ); echo $post_type->label ; ?></a></div>
<div class="entry-top">
<h2 class="entry-title4"><a href="<?php the_permalink() ?>" title="<?php printf( __('Permalink to %s', 'wpbx'), the_title_attribute('echo=0') ) ?>" rel="bookmark"><?php the_title() ?></a></h2>
<div class="entry-meta-top">
<span class="entry-date"><font color="#999999"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></font></span>
</div>
</div>
</div>
<div class="entry-meta entry-bottom2">
</div>
//Column code post seventeen - eighteen
<?php elseif ($count <= 18) : ?>
<div class="entry">
<div class="entry-content clearfix">
<div class="type"><a href="<?php echo get_post_type( $post->ID ); ?>"><?php $post_type = get_post_type_object( get_post_type($post) ); echo $post_type->label ; ?></a></div>
<div class= "entry-list-thumb">
<a href="<?php the_permalink(); ?>" title="<?php printf(__( 'Read %s', 'wpbx' ), wp_specialchars(get_the_title(), 1)) ?>">
<?php the_post_thumbnail(); ?>
</a>
</div>
</div>
<div class="entry-top">
<h2 class="entry-title4"><a href="<?php the_permalink() ?>" title="<?php printf( __('Permalink to %s', 'wpbx'), the_title_attribute('echo=0') ) ?>" rel="bookmark"><?php the_title() ?></a></h2>
<div class="entry-meta-top">
<span class="entry-date"><font color="#999999"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></font></span>
</div>
</div>
<div class="entry-meta entry-bottom2">
</div>
//Column code post nineteen through 22
<?php elseif ($count <= 22) : ?>
<div class="entry4">
<div class="entry-content clearfix">
<div class="type"><a href="<?php echo get_post_type( $post->ID ); ?>"><?php $post_type = get_post_type_object( get_post_type($post) ); echo $post_type->label ; ?></a></div>
<div class="entry-top">
<h2 class="entry-title4"><a href="<?php the_permalink() ?>" title="<?php printf( __('Permalink to %s', 'wpbx'), the_title_attribute('echo=0') ) ?>" rel="bookmark"><?php the_title() ?></a></h2>
<div class="entry-meta-top">
<span class="entry-date"><font color="#999999"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></font></span>
</div>
</div>
</div>
<div class="entry-meta entry-bottom2">
</div>
<?php else : ?>
<?php endif; ?>
</div><!-- .post -->
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>
<div style="clear:both;"></div>
<div class="navigation clearfix">
<?php wp_pagenavi(); ?>
</div>
</div><!-- #content -->
<?php get_sidebar() ?>
<?
require_once('footer.php'); // aka the bottom
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment