Guest User

Untitled

a guest
Sep 13th, 2013
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <ul>
  2. <?php
  3.  
  4.  $args= array(
  5.   'posts_per_page' => -1
  6. );
  7.   query_posts($args);
  8. if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>      
  9.     <li>
  10.  
  11.          <?php
  12.     $args = array(
  13.       'posts_per_page' => -1,
  14.         'meta_key' => 'user_submit_name',
  15.      'meta_value' => get_the_author(),
  16.      'meta_compare' => '='
  17.     );
  18.     $myquery = new WP_Query($args);
  19.  
  20.     echo '<h2>Found: ' . $myquery->found_posts . '</h2> by ' . get_the_author() . '</h2><br>';
  21.  
  22.     while ( $myquery->have_posts() ) {
  23.         $myquery->the_post();
  24.         echo '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
  25.     }
  26. ?>
  27.  
  28.      <?php   wp_reset_postdata(); ?>
  29.  
  30.     </li>  
  31.  
  32. <?php endwhile; ?> <?php endif; ?>
  33. </ul>
Advertisement
Add Comment
Please, Sign In to add comment