{"id":284,"date":"2013-01-14T21:09:49","date_gmt":"2013-01-14T21:09:49","guid":{"rendered":"https:\/\/shan.info\/new\/plugin-nextgen-gallery-show-title-alt-of-image-instead\/"},"modified":"2013-01-14T21:09:49","modified_gmt":"2013-01-14T21:09:49","slug":"plugin-nextgen-gallery-show-title-alt-of-image-instead","status":"publish","type":"post","link":"https:\/\/shan.info\/new\/plugin-nextgen-gallery-show-title-alt-of-image-instead\/","title":{"rendered":"[Plugin: NextGEN Gallery] show Title alt of image instead"},"content":{"rendered":"<p>\n\t&nbsp;<\/p>\n<p style=\"margin: 0px 0px 11px; padding: 0px; color: rgb(51, 51, 51); font-family: sans-serif; font-size: 13px; line-height: 22px;\">\n\tview\/gallery.php.<\/p>\n<p style=\"margin: 0px 0px 11px; padding: 0px; color: rgb(51, 51, 51); font-family: sans-serif; font-size: 13px; line-height: 22px;\">\n\t&nbsp;<\/p>\n<div>\n\t&lt;!&#8211; Thumbnails &#8211;&gt;<\/div>\n<div>\n\t&lt;?php foreach ( $images as $image ) : ?&gt;<\/div>\n<div>\n\t&nbsp;<\/div>\n<div>\n\t&lt;div id=&#8221;ngg-image-&lt;?php echo $image-&gt;pid ?&gt;&#8221; class=&#8221;ngg-gallery-thumbnail-box&#8221; &lt;?php echo $image-&gt;style ?&gt; &gt;<\/div>\n<div>\n\t&lt;div class=&#8221;ngg-gallery-thumbnail&#8221; &gt;<\/div>\n<div>\n\t<span style=\"color:#ff0000;\">&lt;?php echo $image-&gt;alttext ?&gt;<\/span><\/div>\n<div>\n\t&lt;a href=&#8221;&lt;?php echo $image-&gt;imageURL ?&gt;&#8221; title=&#8221;&lt;?php echo $image-&gt;description ?&gt;&#8221; &lt;?php echo $image-&gt;thumbcode ?&gt; &gt;<\/div>\n<div>\n\t&lt;?php if ( !$image-&gt;hidden ) { ?&gt;<\/div>\n<div>\n\t&lt;img title=&#8221;&lt;?php echo $image-&gt;alttext ?&gt;&#8221; alt=&#8221;&lt;?php echo $image-&gt;alttext ?&gt;&#8221; src=&#8221;&lt;?php echo $image-&gt;thumbnailURL ?&gt;&#8221; &lt;?php echo $image-&gt;size ?&gt; \/&gt;<\/div>\n<div>\n\t&lt;?php } ?&gt;<\/div>\n<div>\n\t&lt;\/a&gt;<\/div>\n<div>\n\t&lt;\/div&gt;<\/div>\n<div>\n\t&lt;\/div&gt;<\/div>\n<p style=\"margin: 0px 0px 11px; padding: 0px; color: rgb(51, 51, 51); font-family: sans-serif; font-size: 13px; line-height: 22px;\">\n\t&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p style=\"margin: 0px 0px 11px; padding: 0px; color: rgb(51, 51, 51); font-family: sans-serif; font-size: 13px; line-height: 22px;\">\n\tIn the nextgen plugin dir, edit the file view\/gallery.php.<\/p>\n<p style=\"margin: 0px 0px 11px; padding: 0px; color: rgb(51, 51, 51); font-family: sans-serif; font-size: 13px; line-height: 22px;\">\n\tFind the line of code for the anchor (link) around the thumbnail:<\/p>\n<p style=\"margin: 0px 0px 11px; padding: 0px; color: rgb(51, 51, 51); font-family: sans-serif; font-size: 13px; line-height: 22px;\">\n\t<code style=\"font-family: Consolas, Monaco, 'Courier New', Courier, monospace; color: rgb(0, 0, 0);\">&lt;a href=\"&lt;?php echo $image-&gt;imageURL ?&gt;\" title=\"&lt;?php echo $image-&gt;description ?&gt;\" &lt;?php echo $image-&gt;thumbcode ?&gt; &gt;<\/code><\/p>\n<p style=\"margin: 0px 0px 11px; padding: 0px; color: rgb(51, 51, 51); font-family: sans-serif; font-size: 13px; line-height: 22px;\">\n\tReplace the title attribute with:<br \/>\n\t<code style=\"font-family: Consolas, Monaco, 'Courier New', Courier, monospace; color: rgb(0, 0, 0);\">&lt;?php echo $image-&gt;alttext ?&gt;<\/code><\/p>\n<p style=\"margin: 0px 0px 11px; padding: 0px; color: rgb(51, 51, 51); font-family: sans-serif; font-size: 13px; line-height: 22px;\">\n\tResult:<br \/>\n\t<code style=\"font-family: Consolas, Monaco, 'Courier New', Courier, monospace; color: rgb(0, 0, 0);\">&lt;a href=\"&lt;?php echo $image-&gt;imageURL ?&gt;\" title=\"&lt;?php echo $image-&gt;alttext ?&gt;\" &lt;?php echo $image-&gt;thumbcode ?&gt; &gt;<\/code><\/p>\n<p style=\"margin: 0px 0px 11px; padding: 0px; color: rgb(51, 51, 51); font-family: sans-serif; font-size: 13px; line-height: 22px;\">\n\tExplanation: The effects like the Shutter box use the anchor title attribute to display text under the image. NextGen defaults this to the description field, but the edit above will replace this default with the alttext field.<\/p>\n<p style=\"margin: 0px 0px 11px; padding: 0px; color: rgb(51, 51, 51); font-family: sans-serif; font-size: 13px; line-height: 22px;\">\n\tHope that helps!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; view\/gallery.php. &nbsp; &lt;!&#8211; Thumbnails &#8211;&gt; &lt;?php foreach ( $images as $image ) : ?&gt; &nbsp; &lt;div id=&#8221;ngg-image-&lt;?php echo $image-&gt;pid ?&gt;&#8221; class=&#8221;ngg-gallery-thumbnail-box&#8221; &lt;?php echo $image-&gt;style ?&gt; &gt; &lt;div class=&#8221;ngg-gallery-thumbnail&#8221; &gt; &lt;?php echo $image-&gt;alttext ?&gt; &lt;a href=&#8221;&lt;?php echo $image-&gt;imageURL ?&gt;&#8221; title=&#8221;&lt;?php echo $image-&gt;description ?&gt;&#8221; &lt;?php echo $image-&gt;thumbcode ?&gt; &gt; &lt;?php if ( !$image-&gt;hidden ) { ?&gt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[],"class_list":["post-284","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/comments?post=284"}],"version-history":[{"count":0,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/284\/revisions"}],"wp:attachment":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/media?parent=284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/categories?post=284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/tags?post=284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}