$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>List of pages of a specific user|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

List of pages of a specific user

matteradmin8PV0评论

How to get list of pages of a specific user? And show them in a WordPress page.

Say i have page1 , page2 , page3 , page4 created by User1 . How to list them in a page like this:

  1. page1 created: 1/1/2018 - 11:12 AM
  2. page2 created: 2/1/2018 - 10:00 PM
  3. page3 created: 3/1/2018 - 09:11 AM
  4. page4 created: 4/1/2018 - 12:12 PM

How to get list of pages of a specific user? And show them in a WordPress page.

Say i have page1 , page2 , page3 , page4 created by User1 . How to list them in a page like this:

  1. page1 created: 1/1/2018 - 11:12 AM
  2. page2 created: 2/1/2018 - 10:00 PM
  3. page3 created: 3/1/2018 - 09:11 AM
  4. page4 created: 4/1/2018 - 12:12 PM
Share Improve this question edited Nov 8, 2018 at 17:51 return asked Nov 8, 2018 at 17:45 returnreturn 1191 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I have found how to do it.

Here is the code:

$author_query = array('posts_per_page' => '-1','author' => 1,'post_type' => 'PAGE');
$author_posts = new WP_Query($author_query);
while($author_posts->have_posts()) : $author_posts->the_post();
?>
    ■ <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> <br />      
<?php           
endwhile;

more information: see here

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far