{"id":235,"date":"2015-11-18T18:43:48","date_gmt":"2015-11-18T18:43:48","guid":{"rendered":"http:\/\/buddydev.com\/docs\/?p=235"},"modified":"2015-11-18T18:43:48","modified_gmt":"2015-11-18T18:43:48","slug":"bp-gallery-shortcodes","status":"publish","type":"post","link":"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/","title":{"rendered":"BP Gallery Shortcodes"},"content":{"rendered":"<p>TOC:-<\/p>\n<ul>\n<li><a href=\"#intro\">Introduction to bp-gallery shortcode<\/a><\/li>\n<li><a href=\"#embedding-galleries\">Including galleries in posts<\/a><\/li>\n<li><a href=\"#embedding-media\">Including media[photo\/audio\/video in post]<\/a><\/li>\n<\/ul>\n<p><a name=\"intro\"><\/a><\/p>\n<h3>Introduction<\/h3>\n<p>Currently, BP Gallery enables you to use shortcodes to embed the media into your blog posts. It&#8217;s easy and versatile. There is only one shortcode and you can use a combination of parameters to embed what you want.<\/p>\n<h3>Shortcode:-<\/h3>\n<p>Sample short code<\/p>\n<p>[<strong>bp-gallery<\/strong> param1=&#8221;something&#8221;\u00a0 param2=&#8221;something&#8221; &#8230;.]<\/p>\n<p>where &#8220;<strong>bp-gallery<\/strong>&#8221; is the shortcode and param1\/param2 are various arguments as described below:-<\/p>\n<p>Available arguments:-<\/p>\n<ul>\n<li><strong>owner_type<\/strong>:- optional. Its value could be [user\/groups\/events]. It will depend on whether you want to embed user galleries or group galleries or events gallery\/media<\/li>\n<li><strong>show<\/strong>:-Optional. default value is &#8220;gallery&#8221;. It controls whether to embed some galleries or media . Possible values are :-gallery\/media<\/li>\n<li><strong>owner_id<\/strong>:- optional. In case you know the owner id[i.e user id\/group id], I am sure you won&#8217;t be using this argument, If you are specifying the owner_id, you must specify the &#8220;owner_type&#8221;<\/li>\n<li><strong>owner_slug<\/strong>:- optional. This is actually the user name \/group slug whose gallery\/media you want to embed, depending on the owner type, you can either specify a user name[e.g admin for admin&#8217;s gallery] or group slug[e.g test-group for including test group&#8217;s galleries]. <strong>Please note, if you are specifying owner_slug, you should always specify the owner_type<\/strong><\/li>\n<li><strong>gallery_id<\/strong>:- optional, In case you are a database pro and feel very much inclined to use the knowledge, otherwise just do not use it. It there just for option.<\/li>\n<li><strong>gallery_slug<\/strong>:- optional,\u00a0 If you want to embed all the media of a gallery in your post, you can specify the gallery slug[you can check it in the url], It&#8217;s easy, but <strong>It needs you to use the show=&#8221;media&#8221; and you must specify owner type and owner slug\/id<\/strong><\/li>\n<li><strong>orderby<\/strong>:- optional, possible values[ date\/random\/alphabet]<\/li>\n<li><strong>type<\/strong>: optional, you can use it to limit the type of embedded media. possible values [photo\/video\/audio]<\/li>\n<li><strong>max<\/strong>:- optional how many you want to show, by default is set to 5<\/li>\n<\/ul>\n<p>Please note, gallery slug can be only used when you want to really embed media from a gallery. Also note, the requirement like some of the options must be specified in order to use others. Now let us see some examples:-<\/p>\n<h3>Examples:-<\/h3>\n<p><a name=\"embedding-galleries\"><\/a><\/p>\n<h3>Embedding galleries:-<\/h3>\n<p><strong>Embed 5 most recently updated sitewide galleries<\/strong><\/p>\n<p>[bp-gallery orderby=&#8221;date&#8221;\u00a0 max=&#8221;5&#8243;]<\/p>\n<p><strong>Include 5 most recently updated user galleries<\/strong><\/p>\n<p>[bp-gallery owner_type=&#8221;user&#8221;\u00a0 max=&#8221;5&#8243;\u00a0 orderby=&#8221;date&#8221; ]<\/p>\n<p><strong>Embedding 5\u00a0 galleries of a user in the post<\/strong><\/p>\n<p>[bp-gallery owner_type=&#8221;user&#8221; owner_slug=&#8221;admin&#8221;\u00a0 ]<\/p>\n<p>It will embed the 5 galleries of admin[admin is the username ] into the post.<\/p>\n<p><strong>Now, let us only include 3 photo gallery<\/strong><\/p>\n<p>[bp-gallery owner_type=&#8221;user&#8221; owner_slug=&#8221;admin&#8221; type=&#8221;photo&#8221; max=&#8221;3&#8243;\u00a0 ]<\/p>\n<p>The above code filters the gallery type to photo and includes only 3 galleries.<\/p>\n<p><strong>Including Group galleries in the post:-<\/strong><\/p>\n<p><strong>Include 5 most recently updated group galleries:-<\/strong><\/p>\n<p>[bp-gallery owner_type=&#8221;groups&#8221; max=&#8221;5&#8243; ]<\/p>\n<p><strong>Embed 5 galleries from\u00a0 a group Test whose lug is &#8220;test-group&#8221; to post<\/strong><\/p>\n<p>[bp-gallery owner_type=&#8221;groups&#8221; owner_slug=&#8221;test-group&#8221;\u00a0 ]<\/p>\n<p><strong>Now , let us include 4 photo gallery from test group<\/strong><\/p>\n<p>[bp-gallery owner_type=&#8221;user&#8221; owner_slug=&#8221;admin&#8221;\u00a0 type=&#8221;photo&#8221;\u00a0 max=&#8221;4&#8243;]<\/p>\n<p>Similarly you can do for video\/audio.<\/p>\n<p>&#8230;..and so on. Please experiment and let me know in forums what we need to improve.<br \/>\n<a name=\"embedding-media\"><\/a><\/p>\n<h3>Embedding media:-<\/h3>\n<p><em><strong>For including media, you must specify the show=&#8221;media&#8221; in the shortcode<\/strong><\/em><\/p>\n<p><strong>Include most recently updated 10 photos from users<\/strong><\/p>\n<p>[bp-gallery show=&#8221;media&#8221; owner_type=&#8221;user&#8221; orderby=&#8221;date&#8221;\u00a0\u00a0 type=&#8221;photo&#8221; max=&#8221;10&#8243;\u00a0 ]<\/p>\n<p><strong>So, to include 10 most recent photos of admin, we will do something like this<\/strong><\/p>\n<p>[bp-gallery show=&#8221;media&#8221; owner_type=&#8221;user&#8221; owner_slug=&#8221;admin&#8221;\u00a0\u00a0 type=&#8221;photo&#8221; max=&#8221;10&#8243;\u00a0 ]<\/p>\n<p><strong>Include 10 most recent photos from groups<\/strong><\/p>\n<p>[bp-gallery show=&#8221;media&#8221; owner_type=&#8221;groups&#8221;\u00a0\u00a0\u00a0 type=&#8221;photo&#8221; max=&#8221;10&#8243;\u00a0 ]<\/p>\n<p><strong>Include 10 Most recent Photos from\u00a0 test-group<\/strong><\/p>\n<p>[bp-gallery show=&#8221;media&#8221; owner_type=&#8221;groups&#8221; owner_slug=&#8221;test-group&#8221;\u00a0\u00a0 type=&#8221;photo&#8221; max=&#8221;10&#8243;\u00a0 ]<\/p>\n<p><strong>Include\u00a0 5 images from\u00a0 a gallery named test gallery[slug:test-gallery] belonging to Use xyz with username &#8220;xyz&#8221;<\/strong><\/p>\n<p>[bp-gallery show=&#8221;media&#8221; owner_type=&#8221;user&#8221; owner_slug=&#8221;xyz&#8221;\u00a0 gallery_slug=&#8221;test-gallery&#8221;\u00a0\u00a0 max=&#8221;10&#8243;\u00a0 ]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TOC:- Introduction to bp-gallery shortcode Including galleries in posts Including media[photo\/audio\/video in post] Introduction Currently, BP Gallery enables you to use shortcodes to embed the media into your blog posts. It&#8217;s easy and versatile. There is only one shortcode and you can use a combination of parameters to embed what you want. Shortcode:- Sample short &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["clearfix","post-235","post","type-post","status-publish","format-standard","hentry","category-bp-gallery"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>BP Gallery Shortcodes &#8226; BuddyDev Help Center<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"BP Gallery Shortcodes &#8226; BuddyDev Help Center\" \/>\n<meta property=\"og:description\" content=\"TOC:- Introduction to bp-gallery shortcode Including galleries in posts Including media[photo\/audio\/video in post] Introduction Currently, BP Gallery enables you to use shortcodes to embed the media into your blog posts. It&#8217;s easy and versatile. There is only one shortcode and you can use a combination of parameters to embed what you want. Shortcode:- Sample short ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/\" \/>\n<meta property=\"og:site_name\" content=\"BuddyDev Help Center\" \/>\n<meta property=\"article:published_time\" content=\"2015-11-18T18:43:48+00:00\" \/>\n<meta name=\"author\" content=\"Brajesh Singh\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brajesh Singh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/\",\"url\":\"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/\",\"name\":\"BP Gallery Shortcodes &#8226; BuddyDev Help Center\",\"isPartOf\":{\"@id\":\"https:\/\/buddydev.com\/docs\/#website\"},\"datePublished\":\"2015-11-18T18:43:48+00:00\",\"author\":{\"@id\":\"https:\/\/buddydev.com\/docs\/#\/schema\/person\/4ebf5f3e519f8cbddc6583e182dbe4fb\"},\"breadcrumb\":{\"@id\":\"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/buddydev.com\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"BP Gallery Shortcodes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/buddydev.com\/docs\/#website\",\"url\":\"https:\/\/buddydev.com\/docs\/\",\"name\":\"BuddyDev Help Center\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/buddydev.com\/docs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/buddydev.com\/docs\/#\/schema\/person\/4ebf5f3e519f8cbddc6583e182dbe4fb\",\"name\":\"Brajesh Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/buddydev.com\/docs\/#\/schema\/person\/image\/\",\"url\":\"\/\/www.gravatar.com\/avatar\/2106622ee90d53d15ac1402806616aca?s=96&#038;r=g&#038;d=identicon\",\"contentUrl\":\"\/\/www.gravatar.com\/avatar\/2106622ee90d53d15ac1402806616aca?s=96&#038;r=g&#038;d=identicon\",\"caption\":\"Brajesh Singh\"},\"sameAs\":[\"http:\/\/buddydev.com\/members\/sbrajesh\/\",\"https:\/\/x.com\/sbrajesh\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"BP Gallery Shortcodes &#8226; BuddyDev Help Center","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/","og_locale":"en_US","og_type":"article","og_title":"BP Gallery Shortcodes &#8226; BuddyDev Help Center","og_description":"TOC:- Introduction to bp-gallery shortcode Including galleries in posts Including media[photo\/audio\/video in post] Introduction Currently, BP Gallery enables you to use shortcodes to embed the media into your blog posts. It&#8217;s easy and versatile. There is only one shortcode and you can use a combination of parameters to embed what you want. Shortcode:- Sample short ...","og_url":"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/","og_site_name":"BuddyDev Help Center","article_published_time":"2015-11-18T18:43:48+00:00","author":"Brajesh Singh","twitter_misc":{"Written by":"Brajesh Singh","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/","url":"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/","name":"BP Gallery Shortcodes &#8226; BuddyDev Help Center","isPartOf":{"@id":"https:\/\/buddydev.com\/docs\/#website"},"datePublished":"2015-11-18T18:43:48+00:00","author":{"@id":"https:\/\/buddydev.com\/docs\/#\/schema\/person\/4ebf5f3e519f8cbddc6583e182dbe4fb"},"breadcrumb":{"@id":"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/buddydev.com\/docs\/bp-gallery\/bp-gallery-shortcodes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/buddydev.com\/docs\/"},{"@type":"ListItem","position":2,"name":"BP Gallery Shortcodes"}]},{"@type":"WebSite","@id":"https:\/\/buddydev.com\/docs\/#website","url":"https:\/\/buddydev.com\/docs\/","name":"BuddyDev Help Center","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/buddydev.com\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/buddydev.com\/docs\/#\/schema\/person\/4ebf5f3e519f8cbddc6583e182dbe4fb","name":"Brajesh Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buddydev.com\/docs\/#\/schema\/person\/image\/","url":"\/\/www.gravatar.com\/avatar\/2106622ee90d53d15ac1402806616aca?s=96&#038;r=g&#038;d=identicon","contentUrl":"\/\/www.gravatar.com\/avatar\/2106622ee90d53d15ac1402806616aca?s=96&#038;r=g&#038;d=identicon","caption":"Brajesh Singh"},"sameAs":["http:\/\/buddydev.com\/members\/sbrajesh\/","https:\/\/x.com\/sbrajesh"]}]}},"_links":{"self":[{"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/posts\/235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/comments?post=235"}],"version-history":[{"count":1,"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/posts\/235\/revisions"}],"predecessor-version":[{"id":236,"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/posts\/235\/revisions\/236"}],"wp:attachment":[{"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/media?parent=235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/categories?post=235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/tags?post=235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}