Skip to content

Instantly share code, notes, and snippets.

@Ulv
Created May 9, 2014 08:35
Show Gist options
  • Save Ulv/b9f3a6bb1b6c2ca0d221 to your computer and use it in GitHub Desktop.
Save Ulv/b9f3a6bb1b6c2ca0d221 to your computer and use it in GitHub Desktop.
joomla 3: select last 6 featured articles
/*
*last 6 featured articles
*/
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('*')
->from($db->quoteName('#__content'))
->where($db->quoteName('featured') . ' = 1 ')
->order('created DESC');
$db->setQuery($query, 0, 6);
$list = $db->loadObjectList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment