Hello there,
I am a sort of amateur theme developer but i have noticed one thing in my runs in trying to integrate custom post types into my site.
I have set up a custom post type called "Galleries" and it is to hold posts, that contain just a gallery of the images attached to the post.
I have a few posts up, with dummy content under a regular 'post' post type, and then a few galleries up under a 'gallery' post type.
I am using the following code to pass the 'gallery' post type into the query.
add_filter( 'pre_get_posts', 'add_gallery_post_type' );
function add_gallery_post_type( $query ) {
if ( is_home() || is_feed() )
$query->set( 'post_type', array( 'post', 'gallery' ) );
return $query;
}
But for some reason, posts with the gallery shortcode do not work, and the gallery is not loaded. I am not too sure whether there is a glitch, or if im adding the post type
incorrectly causing the gallery shortcode to break.
Thanks!