Retrieving post list of this author meta
-
I want list the titles of the posts of the author who have write current post.
this posts are events, and I would like to view them in date order.
Furthermore, I would like to see future events only.
And maybe … (the hardest) to show only the events of authors who have a specific ‘author meta’
well, I stopped at the beginning: custom query don’t work when I add
“WHERE post_author = $thisuser_id”<?php $thisuser_id = get_the_author_ID(); echo $thisuser_id; $querystr = " SELECT wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id WHERE post_author = $thisuser_id AND wpostmeta.meta_key = 'event_start_date' ORDER BY wpostmeta.meta_value ASC "; $pageposts = $wpdb->get_results($querystr, OBJECT); if ($pageposts):?> <small> <?php _e("Upcoming events"); ?> </small> <ul> <?php foreach ($pageposts as $post): setup_postdata($post);?> <li> <?php the_title(); ?> </li> <?php endforeach; ?> </ul> <?php endif; ?>
any idea?
thanks for your attention.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Retrieving post list of this author meta’ is closed to new replies.