Conditionally adding shortcodes
-
I use a plugin on a lot of my sites that modifies the normal [gallery] shortcode.
On a current site, I would still like this to occur on every page on the site except for a specific post type.
I was thinking that I could do something like this.
if( !is_singular('custom-post-type') ) { add_shortcode('gallery', 'shortcode_function'); }
But this does not stop the new gallery shortcode function from firing. Is this possible to do at all? If so, can someone help point my in the right direction?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Conditionally adding shortcodes’ is closed to new replies.