• 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

Crystal Theme Portfolio Page

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 › General Discussion › Crystal Theme Portfolio Page

This topic is: not resolved

Tagged: crystal, portfolio, theme

  • This topic has 7 replies, 2 voices, and was last updated 12 years, 1 month ago by ikegordon.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • May 11, 2013 at 8:25 am #40440
    ikegordon
    Member

    Would anyone have any suggestions on how to add a slide deck to the top of the portfolio page for the Crystal theme? http://demo.studiopress.com/crystal/templates/my-portfolio

    I'm assuming I would need to edit the code in the Portfolio Page Template (page_portfolio.php)?

    Here is the code for this page template:

    </code></code>
    <p class="p1"><?php</p>
    <p class="p2"></p>
    <p class="p1">// Template Name: Portfolio</p>
    <p class="p2"></p>
    <p class="p1">// Force layout to full-width-content</p>
    <p class="p1">add_filter('genesis_pre_get_option_site_layout', 'crystal_home_layout');</p>
    <p class="p1">function crystal_home_layout($layout) {</p>
    <p class="p1">    $layout = 'full-width-content';</p>
    <p class="p1">    return $layout;</p>
    <p class="p1">}</p>
    <p class="p2"></p>
    <p class="p1">// Add .teaser class to every post, except first 2</p>
    <p class="p1">add_filter('post_class', 'portfolio_post_class');</p>
    <p class="p1">function portfolio_post_class( $classes ) {</p>
    <p class="p1">    $classes[] = 'portfolio';</p>
    <p class="p1">    return $classes;</p>
    <p class="p1">}</p>
    <p class="p2"></p>
    <p class="p1">// Modify length of post excerpts</p>
    <p class="p1">add_filter('excerpt_length', 'custom_excerpt_length');</p>
    <p class="p1">function custom_excerpt_length($length) {</p>
    <p class="p1">    return 15; // pull first 15 words</p>
    <p class="p1">}</p>
    <p class="p2"></p>
    <p class="p1">// Add "View project" link</p>
    <p class="p1">add_filter('the_excerpt', 'child_homepage_excerpt_filter');</p>
    <p class="p1">function child_homepage_excerpt_filter( $text ) {</p>
    <p class="p1">    return sprintf( '%s<a href="%s" class="more-link">%s</a>', $text, get_permalink(), __('View Project', 'crystal') );</p>
    <p class="p1">}</p>
    <p class="p2"></p>
    <p class="p1">// Remove post info and meta info</p>
    <p class="p1">remove_action('genesis_after_post_content', 'genesis_post_meta');</p>
    <p class="p1">remove_action('genesis_before_post_content', 'genesis_post_info');</p>
    <p class="p2"></p>
    <p class="p1">// Move title above post image</p>
    <p class="p1">remove_action('genesis_post_title', 'genesis_do_post_title');</p>
    <p class="p1">add_action('genesis_post_content', 'genesis_do_post_title', 9);</p>
    <p class="p2"></p>
    <p class="p1">// Remove default content for this Page Template</p>
    <p class="p1">remove_action('genesis_post_content', 'genesis_do_post_image');</p>
    <p class="p1">remove_action('genesis_post_content', 'genesis_do_post_content');</p>
    <p class="p2"></p>
    <p class="p1">// Add Featured Image for the Portfolio posts in this Page Template</p>
    <p class="p1">add_action('genesis_post_content', 'crystal_portfolio_do_post_image');</p>
    <p class="p1">function crystal_portfolio_do_post_image() {</p>
    <p class="p1">    $img = genesis_get_image( array( 'format' => 'html', 'size' => 'Portfolio Thumbnail', 'attr' => array( 'class' => 'alignnone post-image' ) ) );</p>
    <p class="p1">    printf( '<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), $img );</p>
    <p class="p1">}</p>
    <p class="p2"></p>
    <p class="p1">// Add Content for the Portfolio posts in this Page Template</p>
    <p class="p1">add_action('genesis_post_content', 'crystal_portfolio_do_post_content');</p>
    <p class="p1">function crystal_portfolio_do_post_content() {</p>
    <p class="p2"></p>
    <p class="p1">    if ( genesis_get_option('crystal_portfolio_content') == 'excerpts' ) {</p>
    <p class="p1">        the_excerpt();</p>
    <p class="p2"></p>
    <p class="p1">    } else {</p>
    <p class="p1">        if ( genesis_get_option('crystal_portfolio_content_archive_limit') )</p>
    <p class="p1">            the_content_limit( (int)genesis_get_option('crystal_portfolio_content_archive_limit'), __('View Project', 'crystal') );</p>
    <p class="p1">        else</p>
    <p class="p1">            the_content(__('View Project', 'crystal'));</p>
    <p class="p1">    }</p>
    <p class="p1">}</p>
    <p class="p2"></p>
    <p class="p1">// Clear float using genesis_custom_loop() $loop_counter variable</p>
    <p class="p1">// Outputs clearing div after every 4 posts</p>
    <p class="p1">// $loop_counter is incremented after this function is run</p>
    <p class="p1">add_action('genesis_after_post', 'portfolio_after_post');</p>
    <p class="p1">function portfolio_after_post() {</p>
    <p class="p1">    global $loop_counter;</p>
    <p class="p2"></p>
    <p class="p1">    if ( $loop_counter == 3 ) {</p>
    <p class="p1">        $loop_counter = -1;</p>
    <p class="p1">        echo '<div class="clear"></div>';</p>
    <p class="p1">    }</p>
    <p class="p1">}</p>
    <p class="p2"></p>
    <p class="p1">// Remove standard loop</p>
    <p class="p1">remove_action('genesis_loop', 'genesis_do_loop');</p>
    <p class="p2"></p>
    <p class="p1">// Add custom loop</p>
    <p class="p1">add_action('genesis_loop', 'portfolio_loop');</p>
    <p class="p1">function portfolio_loop() {</p>
    <p class="p1">    $paged = get_query_var('paged') ? get_query_var('paged') : 1;</p>
    <p class="p2"></p>
    <p class="p1">    $include = genesis_get_option('crystal_portfolio_cat');</p>
    <p class="p1">    $exclude = genesis_get_option('crystal_portfolio_cat_exclude') ? explode(',', str_replace(' ', '', genesis_get_option('crystal_portfolio_cat_exclude'))) : '';</p>
    <p class="p2"></p>
    <p class="p1">    $cf = genesis_get_custom_field('query_args'); // Easter Egg</p>
    <p class="p1">    $args = array('cat' => $include, 'category__not_in' => $exclude, 'showposts' => genesis_get_option('crystal_portfolio_cat_num'), 'paged' => $paged);</p>
    <p class="p1">    $query_args = wp_parse_args($cf, $args);</p>
    <p class="p2"></p>
    <p class="p1">    genesis_custom_loop( $query_args );</p>
    <p class="p1">}</p>
    <p class="p2"></p>
    <p class="p1">genesis();</p>
    
    <code class="plain plain">


    Isaac J Gordon
    [email protected]

    http://demo.studiopress.com/crystal/templates/my-portfolio
    May 11, 2013 at 11:47 am #40473
    Brad Dalton
    Participant

    Specifically, which slide deck are you referring to?

    You can hook it in using a custom widget. The code below has been tested on the Crystal child theme.

    Or hook in the slider directly if it offers a PHP tag or shortcode:

    Copy this PHP code using the view raw link and paste it at the end of your child themes functions file using a text editor like Notepad++.


    Tutorials for StudioPress Themes.

    May 11, 2013 at 12:00 pm #40474
    ikegordon
    Member

    Well, that worked like a charm! I'm still very new to PHP. THANK YOU. If I wanted to affect this custom widget using CSS what tag would I use? For instance, I would like to center this widget on the page and add a bit of space between it and the below content.

    Thank you again!


    Isaac J Gordon
    [email protected]

    May 11, 2013 at 12:02 pm #40475
    ikegordon
    Member

    My apologies. For anyone interested, this was for Slide Deck 2. However, I'm sure you could use this to add in any sort of widget in the custom widgeted area.


    Isaac J Gordon
    [email protected]

    May 11, 2013 at 12:03 pm #40477
    Brad Dalton
    Participant

    Use custom-widget as your selector.

    Why not add the slider first and then style it?

    Please link to it once you have.


    Tutorials for StudioPress Themes.

    May 11, 2013 at 12:06 pm #40478
    ikegordon
    Member

    Please, forgive. Still trying to wrap my head around this. I don't think I need to style it actually. Right now it's floated to the left. How can I center it on the portfolio page. I'm sure it's something very easy I'm missing.


    Isaac J Gordon
    [email protected]

    May 11, 2013 at 12:07 pm #40479
    Brad Dalton
    Participant

    I would need to inspect the element using Firebug so would need the link to the page please.


    Tutorials for StudioPress Themes.

    May 11, 2013 at 12:08 pm #40480
    ikegordon
    Member

    Here you are! http://www.rockincleveland.com/our-fleet/


    Isaac J Gordon
    [email protected]

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘General Discussion’ 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