Support » Plugins » Add comments and tags to gallery view

  • I’m using the Matt’s Community Tags plugin to let people tag my photos etc.

    Does anyone know how to show ‘number of comments’ and ‘people tag’ under each image in the gallery view, like Matt does here: http://ma.tt/2010/04/7on7-event/ ?

    I probably have to edit the ‘media.php’ in wp-includes folder.

    It looks like this:

    <!-- see gallery_shortcode() in wp-includes/media.php -->
    		<div id='$selector' class='gallery galleryid-{$id}'>");
    
    	$i = 0;
    	foreach ( $attachments as $id => $attachment ) {
    		$link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);
    
    		$output .= "<{$itemtag} class='gallery-item'>";
    		$output .= "
    			<{$icontag} class='gallery-icon'>
    				$link
    			</{$icontag}>";
    		if ( $captiontag && trim($attachment->post_excerpt) ) {
    			$output .= "
    				<{$captiontag} class='gallery-caption'>
    				" . wptexturize($attachment->post_excerpt) . "
    				</{$captiontag}>";
    		}
    		$output .= "</{$itemtag}>";
    		if ( $columns > 0 && ++$i % $columns == 0 )
    			$output .= '<br style="clear: both" />';
    	}
    
    	$output .= "
    			<br style='clear: both;' />
    		</div>\n";
    
    	return $output;
    }
  • The topic ‘Add comments and tags to gallery view’ is closed to new replies.