• 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

Change Crystal Portfolio to use Custom Post Type

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 › Change Crystal Portfolio to use Custom Post Type

This topic is: resolved

Tagged: crystal portfolio, Custom Post Type

  • This topic has 2 replies, 1 voice, and was last updated 13 years, 7 months ago by ZeroGravity.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 7, 2013 at 5:52 pm #24893
    ZeroGravity
    Member

    I would like to change the Crystal Portfolio to use a Custom Post Type. I gather changes will need to be made to the portfolio_loop() function at the end of page_portfolio.php just not 100% sure exactly what.

    It would be ideal to change the meta box in the Genesis Theme settings but that would just be bonus points. I am fine hard coding settings in the portfolio_loop() function for now.

    Does anyone have suggestions on what I should change.

    Many Thanks


    Darren Burns
    Zero Gravity Web Works

    March 7, 2013 at 6:20 pm #24900
    ZeroGravity
    Member

    Always the way. Just after I post the question I find the answer that has been staring me in the face the whole time and it seems so simple. I'm not sure if this is correct or best practice but I changed the $args assignment in portfolio_loop() to:

    $args = array('post_type' => 'photo_competition', 'category__not_in' => $exclude, 'showposts' => genesis_get_option('crystal_portfolio_cat_num'), 'paged' => $paged);

    If this isn't the correct way to do it or if there is a better way please let me know. I'm assuming the category__not_in parameter and custom field query_args option will also function. I haven't tested those yet.

    Also if any one knows how to change the theme settings meta box to be able to select a custom post type that would be great.


    Darren Burns
    Zero Gravity Web Works

    March 19, 2013 at 1:43 pm #29478
    ZeroGravity
    Member

    This is what I finally ended up with. I'm still open to any suggestions as to whether there is a better way to do this.

    add_action('genesis_loop', 'photo_competition_loop');
    function photo_competition_loop() {
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    
    $cf = genesis_get_custom_field('terms');
    $args = array(    'post_type' => 'mmt_photo_comp',
    'tax_query' => array(
    array(
    'taxonomy' => 'mmt_photo_categories',
    'field' => 'id',
    'terms' => $cf
    )
    ),
    'showposts' => genesis_get_option('crystal_portfolio_cat_num'),
    'paged' => $paged
    );
    $query_args = wp_parse_args($cf, $args);
    
    genesis_custom_loop( $query_args );
    }

    Darren Burns
    Zero Gravity Web Works

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 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

© 2026 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