Omeka Classic Logo
  • What’s new in Omeka
  • Tutorials
  • Reference
    • Global (Theming) Functions
    • Hooks
    • Filters
    • models
    • views/helpers
    • controllers
    • Packages
      • Acl
      • Application
      • Auth
      • Captcha
      • Controller
      • Db
      • File\Derivative
      • Filter
      • Form
      • Global Functions
        • Db-related functions
        • Locale-related functions
        • Log-related functions
        • Plugin-related functions
        • Search-related functions
        • Text-related functions
        • User-related functions
        • Utility-related functions
        • View-related functions
      • Http
      • Install
      • Job
      • Navigation
      • Output
      • Plugin
      • Record
      • Session
      • Storage
      • Test
      • Validate
      • View
    • libraries/Omeka
    • Omeka REST API
  • Helping With Documentation
  • Registering a new module or theme with omeka.org
Omeka Classic
  • Reference
  • Global (Theming) Functions
  • get_random_featured_items — Get random featured items.
  • View page source

get_random_featured_items — Get random featured items.

Item-related functions

Summary

get_random_featured_items($num = 5, $hasImage = null)

Get random featured items.

Parameters:
  • $num (int) – The maximum number of recent items to return

  • $hasImage (bool|null)

Returns:

array|Item

Usage

Examples

To display a given number of featured items on a page, use this function and pass in the number of items desired:

<div id="featured-item">
    <h2><?php echo __('Featured Item'); ?></h2>
    <?php echo random_featured_items(2); ?>
</div>

See Also

  • get_display_records

Previous Next

© Copyright 2012-2023, Omeka.

Built with Sphinx using a theme provided by Read the Docs.