Advertisement
Guest User

Untitled

a guest
Feb 24th, 2012
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.10 KB | None | 0 0
  1. <!-- articles -->
  2.         <?php $my_query = new WP_Query(array('category_name' => 'articles', 'posts_per_page' =>1, 'post__not_in' => $do_not_duplicate));
  3.                           while ($my_query->have_posts()) : $my_query->the_post();
  4.                           $do_not_duplicate[] = $post->ID; ?>
  5.             <?php
  6.                 // Get the ID of a given category
  7.                 $category_id = get_cat_ID( 'articles' );
  8.                 // Get the URL of this category
  9.                 $category_link = get_category_link( $category_id );
  10.             ?>
  11.             <article class="centre-margin">
  12.                 <header>
  13.                     <h1><a href="<?php echo esc_url( $category_link ); ?>">// Articles</a></h1>
  14.                 </header>
  15.                 <div class="related-thumb">
  16.                     <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail( 'cat-post-thumb'); ?></a>
  17.                 </div>
  18.                 <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  19.                 <time datetime="<?php echo the_time('j-m-Y'); ?>" pubdate><?php echo ''.get_the_time('j').' '.''.get_the_time('M').' '.get_the_time('Y').''; ?></time>
  20.                 <p><?php the_excerpt(); ?></p>
  21.             </article>
  22.         <?php endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement