SHOW:
|
|
- or go back to the newest paste.
1 | <ul> | |
2 | <?php | |
3 | - | $args= array( |
3 | + | |
4 | - | 'posts_per_page' => -1 |
4 | + | $args= array( |
5 | 'posts_per_page' => -1 | |
6 | - | query_posts($args); |
6 | + | ); |
7 | - | if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> |
7 | + | query_posts($args); |
8 | - | <li> |
8 | + | if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> |
9 | - | <?php |
9 | + | <li> |
10 | - | $args = array( |
10 | + | |
11 | - | 'posts_per_page' => -1, |
11 | + | <?php |
12 | - | 'meta_key' => 'user_submit_name', |
12 | + | $args = array( |
13 | - | 'meta_value' => get_the_author(), |
13 | + | 'posts_per_page' => -1, |
14 | - | 'meta_compare' => '=' |
14 | + | 'meta_key' => 'user_submit_name', |
15 | - | ); |
15 | + | 'meta_value' => get_the_author(), |
16 | - | $myquery = new WP_Query($args); |
16 | + | 'meta_compare' => '=' |
17 | - | echo '<h2>Trovate: ' . $myquery->found_posts . ' proposte</h2> di ' . get_the_author() . '</h2>'; |
17 | + | |
18 | - | ?> |
18 | + | $myquery = new WP_Query($args); |
19 | - | <a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a> |
19 | + | |
20 | - | <?php wp_reset_postdata(); ?> |
20 | + | echo '<h2>Found: ' . $myquery->found_posts . '</h2> by ' . get_the_author() . '</h2><br>'; |
21 | - | </li> |
21 | + | |
22 | - | <?php endwhile; ?> <?php endif; ?> |
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> |