Advertisement
pusatdata

WP-Trik: List Title Post by Tag with Permalink

Apr 24th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement