0

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
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.