• Hey guys, I’ve got a solar panels blog I’ve been working on for a while now. I’m trying to return all posts by a particular user of a particular custom post type with the following code snippet:

    $args = array(
    'numberposts'     => 1,
    'post_type'       => 'company',
    'post_status'	  => 'publish',
    'post_author'	  => $current_user->ID);

    The results are however returning the following:….
    Array ( [0] => stdClass Object ( [ID] => 761 [post_author] => 2
    (which is ok, as I was viewing that as user 2.
    Array ( [0] => stdClass Object ( [ID] => 758 [post_author] => 28
    But then this has user ID 28 as well. The only relation is that they both start with a 2….

    Has anyone got a method that I could use to force it to constrain it to the exact value of $current_user->ID;?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘get_posts() Query returning odd results..’ is closed to new replies.