Advertisement
Guest User

Untitled

a guest
Apr 20th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.37 KB | None | 0 0
  1. if (is_front_page()) { ?>
  2.     <?php
  3.     $paged = get_query_var('page') ? get_query_var('page') : 1;
  4.     $args = array (
  5.         'post_status' => 'publish',
  6.         'posts_per_page' => 10,
  7.         'paged' => $paged,
  8.         'meta_query' => array(
  9.             array(
  10.                 'key' => 'happenings_promoted',
  11.                 'value' => 'Home (feed)'
  12.                 )
  13.             )
  14.         );
  15.     $myquery = new WP_Query($args);
  16.     while ($myquery->have_posts()) : $myquery->the_post(); ?>
  17.     <div class="story_box post_feed">
  18.         <a class="full_link" href="<?php echo the_permalink(); ?>"></a>
  19.         <div class="clip_content">
  20.         <a href="<?php echo the_permalink(); ?>"><h4>
  21.             <?php
  22.             $alternate_title = get_post_meta($post->ID, 'happenings_alternate_title', true);
  23.             if ($alternate_title != '') {
  24.                 echo $alternate_title;
  25.             } else {
  26.                 the_title();
  27.             }
  28.             ?>
  29.         </h4>
  30.         <?php
  31.             $teaser = get_post_meta($post->ID, 'happenings_teaser', true);
  32.             if ($teaser != '') { ?>
  33.                 <p><?php echo $teaser ?></p>
  34.             <?php
  35.             } else {
  36.                 the_excerpt();  
  37.             }
  38.             if (has_post_thumbnail( $post->ID ) ) {
  39.                 $imgdata = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
  40.                 $fullWidth = $imgdata[1];
  41.                 if ( $fullWidth > 263 ) {
  42.                     echo get_the_post_thumbnail( $post->ID, 'thumbnail');
  43.                 }  
  44.             }
  45.             ?>
  46.     </div> <!-- close story_box -->
  47.     <?php
  48.     endwhile;
  49.     posts_nav_link(' — ', __('&laquo; Newer Posts'), __('Older Posts &raquo;'));
  50. } else {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement