Skip to content

Instantly share code, notes, and snippets.

@paulhuisman
Created June 25, 2013 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulhuisman/5857988 to your computer and use it in GitHub Desktop.
Save paulhuisman/5857988 to your computer and use it in GitHub Desktop.
<?php
$query = new EntityFieldQuery();
$entities = $query->entityCondition('entity_type', 'node')
->entityCondition('bundle', array('column','blog'))
->propertyCondition('uid', $user->uid)
->propertyCondition('status', 1)
->propertyOrderBy('created', 'DESC')
->range(0, 3)
->execute();
if (!empty($entities['node'])) {
$nodes = node_load_multiple(array_keys($entities['node']));
$articles = node_view_multiple($nodes, 'magazine_teaser');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment