> For the complete documentation index, see [llms.txt](https://playground.e107sk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://playground.e107sk.com/plugin-dev-quick-notes/how-to-1/number-of-gallery-images.md).

# Number of gallery images

```
class theme_shortcodes extends e_shortcode
{
	function sc_gallery_cat_count()
	{
		$cat = e107::getScBatch('gallery', true)->getVars();

		return e107::getMedia()->countImages($cat['media_cat_category']);
	}
}
```

Related: <https://github.com/e107inc/e107/issues/6254#issuecomment-5526100823>
