WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a lil something done and I have looked over Google for and cant seem to find, not even a close solution.

My site is totally user front end with wp-admin being blocked by users. When a user logs in they are taken to a "dashboard".

Each person can only make one post. What i need is something to take the current logged in user and grab the post id of their post. so i can link to their edit page.

share|improve this question
up vote 1 down vote accepted

I am surprised that you didn't find references to the two components that you need. These are both extremely common.

$current_user = wp_get_current_user();
$query = new WP_Query( 
  array (
    'author' => $current_user->ID,
    'posts_per_page' => 1,
    'post_status' => array('any'),
var_dump($query); // debug



share|improve this answer
I wasn't looking to make a loop just to pull in 1 id. Otherwise i would have. – Noob Theory Jul 23 '13 at 4:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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