Question

I'm developing a new custom theme - and noticed that if a post contains the shortcode [gallery] it gets ignored (edit: I mean that the HTML delivered to the browser does not include [gallery], nor anything in its place... I think there's a blank line or two)

My Theme is

  1. grabbing post contents via the_content('→');
  2. also removing the standard <p></p> wrapper via remove_filter('the_content', 'wpautop');

The Codex does not list this as one of the features you explicitly have to add support for - but we know the codex can be outdated/incomplete at times.

Anyways, what is it needed for a theme to recognize [gallery] (and/or other such standard shortcodes) ?

Was it helpful?

Solution

Have you added any images to the page in which you are using the gallery?

The [gallery] shortcode won't work without there actually being attachments on said post.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top