Post Image Gallery After Content Function messes with other content
Move is_single() condition to be inside the function, and you have to return the original content if the condition isn’t satisfied. Your code will look like this: add_filter(‘the_content’, ‘add_content_after’); function add_content_after($content) { global $post; if ( is_single() ) { if ( $post->post_status == ‘publish’ ) { $attachments = get_posts( array( ‘post_type’ => ‘attachment’, ‘posts_per_page’ => … Read more