SHARE
TWEET

WP-Trik: List Title Post by Tag with Permalink

pustakakoran Apr 24th, 2017 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $original_query = $wp_query;
  3. $wp_query = null;
  4. $args=array('posts_per_page'=>500, 'tag' => '' . get_the_date('Ymd') . '');
  5. $wp_query = new WP_Query( $args );
  6. if ( have_posts() ) :
  7.   while (have_posts()) : the_post();
  8.   echo '<li>';
  9.   the_title( '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a>' );
  10.   echo '</li>';
  11.   endwhile;
  12. endif;
  13. $wp_query = null;
  14. $wp_query = $original_query;
  15. wp_reset_postdata();
  16. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top