WordPress Website Templates

Find Professional WordPress themes Easy and Simple to Setup

inner banner

Personalize PhotoGallery

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #519
    Giampaolo Ribaldi
    Participant

    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

    #521
    Grace Themes
    Member

    Hi,

    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 Themes

    #522
    Giampaolo Ribaldi
    Participant

    Thank you so much for your help i really appreciate it.

    Can you pls remove the url on the post? Thank you.

    #523
    Grace Themes
    Member

    Hi,

    You have already deleted the test gallery page.

    Regards
    Grace Themes

    #525
    Giampaolo Ribaldi
    Participant

    I means…. the url of the website on your post..

    #527
    Grace Themes
    Member

    Hi,

    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 Themes

    Regards
    Grace Themes

    #558
    Nir
    Participant

    Hello,

    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??

    #560
    Grace Themes
    Member

    Hi Nir,

    Your website is now showing all the default sections including photo gallery.
    Please check the test gallery page

    http://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 Themes

    #1782
    omtr
    Participant

    hi, 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?

    #1783
    Grace Themes
    Member

    Hi 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-gallery

    Regards
    Grace Themes

    #1786
    omtr
    Participant

    i’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?

    #1789
    Grace Themes
    Member

    Hi 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 Themes

    #2994
    Gnanadoss Siddharth
    Participant

    Please let us know the code to add code in custom_function.php

    Can you share the code.

    #2995
    Grace Themes
    Member

    Hi 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' );
    
    #25351
    as_ks
    Participant

    Hello:
    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

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.