Portfolio Post Type in Ambiance Pro Theme

Community Forums Forums Design Tips and Tricks Portfolio Post Type in Ambiance Pro Theme

This topic is: not resolved

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by  lindebjerg 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #96075

    lindebjerg
    Participant
    Post count: 42

    I have tried to follow the tutorial from Sridhar here: http://sridharkatakam.com/portfolio-post-type-genesis/

    I have this site setup with the Ambiance Pro Theme: http://28.lindebjerg.de/portfolio
    Here I made the changes Sridhar wrote, but I cannot figure out why there are two pictures?
    In his tutorial he uses the Genesis Sample Theme, but where are the differences?

    http://28.lindebjerg.de/portfolio
    #96090

    braddalton
    Participant
    Post count: 10170

    A better solution is to use the code from the Executive Pro theme.


    #96092

    lindebjerg
    Participant
    Post count: 42

    Why better? it does not look the same.
    Sridhar have build in a circle with and glass-icon. When the image is clicked, the full featured image will be shown in a lightbox. Each image will have a transparent overlay caption at the bottom on which first few characters of the excerpt will be shown.

    single portfolio works fine, and the portfolio backend section works fine.

    archive-portfolio.php
    I have 2 problems, I think. How unload the second picture? and how to make the lightbox work?

    <?php
    /**
     * This file adds the custom portfolio post type archive template.
     *
     */
    
    //* Force full width content layout
    add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
    
    //* Remove the breadcrumb navigation
    remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
    
    //* Remove the post info function
    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    
    //* Remove the post content
    remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
    
    //* Remove the post image
    remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
    
    //* Add portfolio body class to the head
    add_filter( 'body_class', 'sk_add_portfolio_body_class' );
    function sk_add_portfolio_body_class( $classes ) {
       $classes[] = 'portfolio-archive-page';
       return $classes;
    }
    
    //* Add featured image below post title with
    add_action( 'genesis_entry_header', 'sk_portfolio_grid' );
    function sk_portfolio_grid() {
    
    	if ( $image = genesis_get_image( 'format=url&size=portfolio' ) ) {
    
    		$my_caption = get_the_excerpt();
    		// If you do not want to show the caption uncomment the line below
    		// $my_caption = '';
    
    		$fullimage = genesis_get_image( 'format=url');
    
    		$my_url = get_permalink();
    
    		// Limit the number of characters so caption text fits in the bottom overlay
    		$my_caption_short = substr($my_caption, 0, 25);
    
    		if ( $my_caption != '' ) {
    
    			printf( '<div class="portfolio-image-wrapper">
    						<div class="portfolio-image">
    							<a href="%s" rel="prettyPhoto[pp_gal]"><img src="%s" alt="%s" class="overlay" /></a>
    						</div>
    
    						<div class="overlay-text">
    							<a href="%s">%s... <em>Read more</em> &raquo;</a>
    						</div>
    					</div>', $fullimage, $image, the_title_attribute( 'echo=0' ), $my_url, $my_caption_short );
    		}
    		else {
    			printf( '<div class="portfolio-image">
    						<a href="%s" rel="prettyPhoto[pp_gal]"><img src="%s" alt="%s" class="overlay" /></a>
    					</div>', $fullimage, $image, the_title_attribute( 'echo=0' ) );
    		}
    
    	}
    
    }
    
    //* Remove the post meta function
    remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
    
    genesis();
    #96094

    braddalton
    Participant
    Post count: 10170

    Using code is more flexible than using a plugin.


    #96146

    lindebjerg
    Participant
    Post count: 42

    You are so right! But I don’t need to be flexible, I just need a working portfolio, when it is setup I will not change it at all.

    But I am not good in code, so I try to use a good written tutorial. I was hoping to get some help here with the 2 problems?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.