Community Forums › Forums › Archived Forums › Design Tips and Tricks › Portfolio Post Type in Ambiance Pro Theme
Tagged: portfolio
- This topic has 4 replies, 2 voices, and was last updated 10 years ago by lindebjerg.
-
AuthorPosts
-
March 22, 2014 at 12:01 pm #96075lindebjergMember
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
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?March 22, 2014 at 1:43 pm #96090Brad DaltonParticipantA better solution is to use the code from the Executive Pro theme.
March 22, 2014 at 2:37 pm #96092lindebjergMemberWhy 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> »</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 #96094Brad DaltonParticipantMarch 23, 2014 at 3:54 am #96146lindebjergMemberYou 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?
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.