WordPress.org

Support

Support » Plugins and Hacks » No image credits for images in galleries

No image credits for images in galleries

Viewing 1 replies (of 1 total)
  • Plugin Author Adam Capriola
    Member

    @adamcapriola

    It does not work for galleries, sorry. The way the plugin works is that is uses a regular expression to match media IDs within the post content, but gallery code does not include the IDs. It could be modified to use the IDs of any image attached to the post, but for my purposes at least I found that to be inaccurate and I would sometimes upload an image to a post then not use it, or use an old image on a new post.

    The credits should show on the attachment page however if you were to use code like this:

    /**
     * Add image credits to the end of attachment pages
     *
     */
    add_filter( 'the_content', 'ac_image_credits' );
    
    function ac_image_credits( $content ) {
    
    	if ( is_singular( 'attachment' ) ) {
    
    		$content .= '<p>[image-credits]</p>';
    
    	}
    
    	return $content;
    
    }

    EDIT: Also I guess if you could find a way to modify the gallery output code to include wp-image-ID with the img’s class, then that would solve the problem.

Viewing 1 replies (of 1 total)
  • The topic ‘No image credits for images in galleries’ is closed to new replies.