I'm using this bit of code on single.php:
$params='[gallery link="file" size="my_thumbnail_small" exclude="'.$featuredId.'"]';
$gallery = do_shortcode($params);
echo $gallery;
But nomatter what I put in the exclude
param, it has absolutely no effect on the output, the image that I'm trying to exclude gets shown every time regardless of the params I use.
My $featuredId
var contains the ID of the post thumbnail / featured image, which in this test case is 93
. I've tried just with exclude="93"
incase it's getting overwritten or something but to no avail.
The theme is an almost completely blank one with nothing but a few add_image_size()
calls in functions.php and the only plugins I'm currently using is file un-attach 1.01. Wordpress is at version 3.3.2.
Anyone have any idea why this isn't doing what I expect?
EDIT: I've tried the accepted answer from this question on SO, still no dice. https://stackoverflow.com/questions/4337999/wordpress-exclude-the-post-thumbnail-from-gallery-shortcode
Maybe there is some theme support I need to add for this to work?
$featuredId=get_post_thumbnail_id();
. When I echo that I get 93. But now you've said that, I'm going to see if I can find out if that's right