Skip to content

Instantly share code, notes, and snippets.

@seanbuscay
Created September 21, 2016 19:47
Show Gist options
  • Save seanbuscay/b932ec904ad890f9f706326c7dd219c5 to your computer and use it in GitHub Desktop.
Save seanbuscay/b932ec904ad890f9f706326c7dd219c5 to your computer and use it in GitHub Desktop.
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node')
->propertyCondition('status', 1)
->propertyCondition('type', array('article', 'page', 'blog'))
->propertyOrderBy('created', 'DESC')
->range(0, 5);
$result = $query->execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment