WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. thatwastaxing
    Member
    Posted 11 months ago #

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

    http://wordpress.org/extend/plugins/image-credits/

  2. Adam Capriola
    Member
    Plugin Author

    Posted 10 months 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.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.