Post ID = Logged in user ID (1 post)

  1. Chibueze Okechukwu
    Posted 3 years ago #

    Is there a way to automatically insert the current user ID as the post category name or maybe have WordPress display only the post with a category name that matches the current logged user ID?

        $query = new WP_Query('category_name=current-user-id');
        if($query->have_posts()) : while($query->have_posts()) : $query->the_post();
           the_content( __('Read the rest of this page ยป', 'template'));
          endwhile; endif;

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 3 years ago by Chibueze Okechukwu
  • This topic is not resolved
  • WordPress version: 3.4.2