SLB doesn’t discriminate between post types. If the “Enable on Posts” option is checked, then SLB will work on any post/custom post type.
If this is not working for you, then please provide a link to a page that exhibits the issue you’re experiencing and I’ll take a look.
Thank you so much for the interest, Archetyped π
Here you go:
Test Gallery
This is a custom post type gallery that uses the regular wordpress gallery shortcode. The .php function behind this only has this:
echo do_shortcode('[gallery]');
Does your theme use the required the_content() template tag? See SLB’s installation and usage notes for more information.
This is what I’m doing:
function gpp_gallery_images($size='large') {
global $post_type;
if ( $post_type == 'gallery' )
echo do_shortcode('[gallery]');;
// Returns the content.
return $content;
}
add_filter( 'the_content', 'gpp_gallery_images', 20 );
And it doesn’t work… Do you have any suggestions?
Filter functions should not output data themselves, but rather pass modified data (e.g. post content) to be filtered by other functions hooked into the same filter. Doing so negates the primary purpose of filters (to allow content to be modified/customized prior to output).
You should add the value from the gallery shortcode to $content prior to returning it in the filter function.
Documentation on filters in WP: http://codex.wordpress.org/Plugin_API#Create_a_Filter_Function
Of course! Than you so much, Archetyped!!
Here’s the code in case if anyone needs it:
function gpp_gallery_images() {
global $post_type;
if ($post_type == 'gallery')
{
$content = $content.'[gallery]';
}
return $content;
}
add_filter('the_content', 'gpp_gallery_images');
PS: Now I just need one last thing to make it perfect…