• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Portfolio Post Type in Ambiance Pro Theme

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved

Tagged: portfolio

  • This topic has 4 replies, 2 voices, and was last updated 11 years, 2 months ago by lindebjerg.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • March 22, 2014 at 12:01 pm #96075
    lindebjerg
    Member

    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
    March 22, 2014 at 1:43 pm #96090
    Brad Dalton
    Participant

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


    Tutorials for StudioPress Themes.

    March 22, 2014 at 2:37 pm #96092
    lindebjerg
    Member

    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();
    March 22, 2014 at 2:52 pm #96094
    Brad Dalton
    Participant

    Using code is more flexible than using a plugin.


    Tutorials for StudioPress Themes.

    March 23, 2014 at 3:54 am #96146
    lindebjerg
    Member

    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?

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble