{"id":2869161,"date":"2012-07-04T06:27:24","date_gmt":"2012-07-04T06:27:24","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/output-shortcode-if-gallery-is-attached-to-post\/"},"modified":"2016-08-20T13:32:43","modified_gmt":"2016-08-20T13:32:43","slug":"output-shortcode-if-gallery-is-attached-to-post","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/output-shortcode-if-gallery-is-attached-to-post\/","title":{"rendered":"Output shortcode if gallery is attached to post"},"content":{"rendered":"<p>Hello,<br \/>\nIm looking for some help regarding a little php to be included in my template file that would check if a gallery of images is attached to a post and then output shortcode.<\/p>\n<p>Something along the lines of<\/p>\n<p>If gallery = true<br \/>\necho do_shortcode &#8216;[portfolio_slideshow]&#8217;<\/p>\n<p>Although I am not sure how to write this properly.<\/p>\n<p>Thanks!<\/p>\n","protected":false},"template":"","class_list":["post-2869161","topic","type-topic","status-closed","hentry","topic-tag-conditional","topic-tag-gallery","topic-tag-shortcode"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2869161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2869161\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2869161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}