Image Credits
No image credits for images in galleries (2 posts)

  1. thatwastaxing
    Posted 3 years ago #

    I just noticed that no credit is given to images that are in a gallery. Is this normal?


  2. Adam Capriola
    Plugin Author

    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Image Credits
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.