Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ul>
- <?php
- $args= array(
- 'posts_per_page' => -1
- );
- query_posts($args);
- if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- <li>
- <?php
- $args = array(
- 'posts_per_page' => -1,
- 'meta_key' => 'user_submit_name',
- 'meta_value' => get_the_author(),
- 'meta_compare' => '='
- );
- $myquery = new WP_Query($args);
- echo '<h2>Found: ' . $myquery->found_posts . '</h2> by ' . get_the_author() . '</h2><br>';
- while ( $myquery->have_posts() ) {
- $myquery->the_post();
- echo '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
- }
- ?>
- <?php wp_reset_postdata(); ?>
- </li>
- <?php endwhile; ?> <?php endif; ?>
- </ul>
Advertisement
Add Comment
Please, Sign In to add comment