Personalize PhotoGallery
- This topic has 15 replies, 2 voices, and was last updated 4 years, 3 months ago by Grace Support.
-
AuthorPosts
-
March 11, 2016 at 1:56 pm #519Giampaolo RibaldiParticipant
Hi,
i would like to personalize the gallery, for add it in different page.
If i add this code [photogallery filter=”true” show=”8″] in html section, the page show ALL pictures inserted in the gallery section, with filter “all, ex1, ex2, etc..”.
But if i want show ONLY a mirated gallery?
For example, i create the category “industry” and i added some pictures. I want use the gallery in the page called “industry” and show only the immage about his category
There is a ways to “filter” the category with this photogallery? Not by selfclick the filter showed.
Thank You
March 11, 2016 at 7:40 pm #521Grace ThemesMemberHi,
I have customize the code in custom-functions.php to create personalize gallery.
Please use this short code in page[photo-category category_id=”4″ show=”4″]
and change the category id of which images you want to display in page.
Regards
Grace ThemesMarch 11, 2016 at 9:07 pm #522Giampaolo RibaldiParticipantThank you so much for your help i really appreciate it.
Can you pls remove the url on the post? Thank you.
March 13, 2016 at 4:05 am #523Grace ThemesMemberHi,
You have already deleted the test gallery page.
Regards
Grace ThemesMarch 13, 2016 at 11:14 am #525Giampaolo RibaldiParticipantI means…. the url of the website on your post..
March 13, 2016 at 4:53 pm #527Grace ThemesMemberHi,
The Test Gallery page that I was created for testing, has been deleted.
It was just for testing purpose of Personalize Photo Gallery.So now you can create photo gallery of images for specific category with this short code
[photo-category category_id=”4″ show=”4″]
Just change the category_id, that you want to display images of that category.
Regards
Grace ThemesRegards
Grace ThemesMarch 17, 2016 at 3:44 am #558NirParticipantHello,
I am trying to implement the shortcode for the photo gallery but it will not show..
I tried the default option: [photogallery filter=”true” show=”8″]
I tried the Category option: [photo-category category_id=”8″ show=”6″]nothing work… any idea why??
March 17, 2016 at 5:57 pm #560Grace ThemesMemberHi Nir,
Your website is now showing all the default sections including photo gallery.
Please check the test gallery pagehttp://ecosmartcontractor.com/test-photo-gallery/
It is displaying photo gallery with shortcode
[photogallery filter=”true” show=”8″]If you want to display photo gallery for single category use this shortcode
[photo-category category_id=”9″ show=”6″]
(change the category id that you want to show images of that category)Regards
Grace ThemesSeptember 27, 2016 at 8:17 pm #1782omtrParticipanthi, i bought the full version but i’m note sure if selecting a gallery is already implemented or just a feature that is manually implemented by request. could you tell me what i got to change in the functions.php?
September 28, 2016 at 4:27 am #1783Grace ThemesMemberHi omtr
The photo gallery is automatically implemented in the theme. You need to add images in photo gallery.
Please check the documentation for customizing the photo gallery section
https://www.gracethemes.com/documentation/zeroerror/#photo-galleryRegards
Grace ThemesSeptember 28, 2016 at 11:26 am #1786omtrParticipanti’m sorry, i think you got me wrong. i just want to show photos from one single category, without the filter element. i think that there is some custom code needed in the functions.php, can you give it to me?
September 29, 2016 at 6:44 am #1789Grace ThemesMemberHi omtr
Please send your website URL and WordPress admin login details at [email protected]
so we can implement changes to show photos from one single category in photo gallery section.Regards
Grace ThemesFebruary 4, 2017 at 8:36 am #2994Gnanadoss SiddharthParticipantPlease let us know the code to add code in custom_function.php
Can you share the code.
February 4, 2017 at 12:28 pm #2995Grace ThemesMemberHi Gnanadoss,
To display Photo Galley for single category use below code at the end of custom_function.php file
And use this shortcode
[photo-category category_id=”9″ show=”20″]
(change the category id to show images of that category)//Photo Galley for single category: [photo-category category_id="5" show="20"] function photo_category_shortcode_func( $atts ) { extract( shortcode_atts( array( 'show' => '', 'category_id' => '', 'filter' => 'false' ), $atts ) ); $pfStr = ''; $pfStr .= '<div class="photobooth">'; $pfStr .= '<div class="row fivecol portfoliowrap"><div class="portfolio">'; $j=0; $args = array( 'post_type' => 'photogallery', 'order' => 'asc', 'posts_per_page' => -1, 'tax_query' => array( array( 'taxonomy' => 'gallerycategory', 'field' => 'ID', 'terms' => $category_id ), ) ); query_posts( $args ); if ( have_posts() ) : while ( have_posts() ) : the_post(); $j++; $videoUrl = get_post_meta( get_the_ID(), 'video_file_url', true); $imgSrc = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full'); $terms = wp_get_post_terms( get_the_ID(), 'gallerycategory', array("fields" => "all")); $slugAr = array(); foreach( $terms as $tv ){ $slugAr[] = $tv->slug; } if ( $imgSrc[0]!='' ) { $imgUrl = $imgSrc[0]; }else{ $imgUrl = get_template_directory_uri().'/images/img_404.png'; } $pfStr .= '<div class="entry '.implode(' ', $slugAr).'"><div class="holderwrap"> <a href="'.( ($videoUrl) ? $videoUrl : $imgSrc[0] ).'" data-rel="prettyPhoto[bkpGallery]"><img src="'.$imgSrc[0].'"/></a> </div></div>'; unset( $slugAr ); endwhile; else: $pfStr .= '<p>Sorry, photo gallery is empty.</p>'; endif; wp_reset_query(); $pfStr .= '</div></div>'; $pfStr .= '</div>'; return $pfStr; } add_shortcode( 'photo-category', 'photo_category_shortcode_func' );
August 13, 2020 at 1:56 pm #25351as_ksParticipantHello:
I used your theme agronomics pro for creating a website. There appeared a problem with displaying certain photos on certain pages. I read the information on the forum, inserted the above mentioned code at the end of custom_function.php file, created the necessary Gallery Category and each photo got its own category. On the page I used Short Codes [photo-category category_id=”cradle_t″ show=”3″]. But instead of the photos of the required category all gallery photos are displayed. For example, https://favoritebaby.ru/?page_id=44. Please help.
Thank you in advance. Anton -
AuthorPosts
- You must be logged in to reply to this topic.