this should work for you:
if ( is_user_logged_in() ):
global $current_user;
wp_get_current_user();
$author_query = array('posts_per_page' => '-1','author' => $current_user->ID);
$author_posts = new WP_Query($author_query);
while($author_posts->have_posts()) : $author_posts->the_post();
?>
<a href="https://wordpress.stackexchange.com/questions/23829/<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
<?php
endwhile;
else :
echo "not logged in";
endif;
Related Posts:
- How to show related posts by category
- the_author() returns empty string
- Query posts distinct authors
- How to get previous 10 days post from a specific date – WP Query
- Show the title of the latest post by author
- Query only Posts from Both of Two Category?
- WordPress get posts by date without query_posts
- Can I set and show “important” post in my blog?
- Inserting custom data to the_post() during loop
- Why is querying posts messing up my pages?
- How to get posts from a current post’s month?
- While loop articles – if statement order
- Display Posts with template on a Page
- Post Filtering by GET URL parameters
- How to give classname to post if post has no content?
- Get x recent posts by author?
- Exclude a category of posts in author template
- Get posts from current category?
- How to merge the content of posts that have the same title?
- get posts, run a custom query, and join the results
- WP_Query to get posts in a specific tag or has post_format
- show latest authors blog post
- How to get all post titles starting with numbers and symbols?
- How to get single post by one author?
- Word count for all posts of all authors
- How to get posts published between a date and today?
- Prevent Authors from viewing each others Posts
- Display Random Author with Details in Sidebar
- get comments and get posts in loop
- How to know if get_posts() failed?
- Can’t show comments count per post outside loop
- Get current users post URL?
- is there a better way of combining this?
- Post author is changed to admin after his post is modified by admin
- How can I control multiple editing of wordpress posts?
- Show the author’s count of total amount of posts assign to a custom taxonomy term
- How only display all post related to category
- WP rest api returns 404 only when author param is used
- How can I list random authors from current post category?
- Filter Posts By Tag
- Encrypt / Decrypt Post Title and Details
- Exclude newest post from category X but show rest
- Reset Popular post query?
- Limit posts per author role (excluding admin) in home page
- Guest Author – How to display posts on /author/ archive page
- Display posts with tag that matches current post title
- Insert Content In Between Post Feed
- Get Posts Under Custom Taxonomy
- Getting the current author (it has changed) of a post, not the original author
- Pagination with an array of post objects?
- Any way for get_next_post() to use the actual post order instead of publish order?
- Multi row post list
- Showing author page if user has no post
- posts_per_page option limits the number of Gallery items
- Posts loop displaying the same post data
- Display Posts on Custom Page
- Show comment number per author per day
- Get all comments of author’s posts
- Counter is skipping post when I still want it visible [closed]
- How to get post content from an array of ids?
- Number of displayed posts
- Query for first 3 posts to change the look and feel
- If contributor has published 2 or more posts then show otherwise hide
- Latest posts by category — how to exclude current post?
- Change post author without using wp_update_post()
- wp_query with ajax
- Custom Articles page only showing a limited number of posts per page
- Custom posts listing widget always returns 1 extra result
- WordPress post filter menu
- Send email to author of post on post submission
- get_posts not pulling the correct number of posts
- Get postlist for each category using query_posts?
- How to save posts position on homepage after random function?
- List latest posts with least comments in WP-Admin
- Cannot select certain authors for posts after import
- Display message depending on capability outside loop
- How do I disable the “by author” hyperlink on posts?
- Authors’ Links on Homepage Not Going to Author Post Pages
- query for filtering published posts?
- Pull in posts using post meta for REST API
- how to show comments only author which send own posts in wordpress
- How to show post views shortcode data for each post on Posts List Page?
- On WordPress Search, how to search post from Author meta also
- How to hide meta from search result only on pages?
- Make recent post display recent updated, instead of recent published
- Numbering author posts in posts query
- Manipulate query to show specific post
- Any difference betweenn posts and pages for one page?
- Sort / Filter Queries
- get_page_by_title() not working if special characters are present
- get “read more” with custom DB query like you would with WP Query
- How do I control the fallback query after the original query returned cero posts?
- Adding a category at even positions on main loop with modified pagination
- Displaying posts on Homepage
- wp trim function not working
- Change from all posts to specific categories post on main page?
- append $_GET parameters to post
- Count words for all posts by all authors
- How to make the Post Author name fixed as “Editorial Staff” even if there are multiple authors?
- Translation related post text to Arabic