• 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

Whitespace: Portfolio projects (Jetpack) also on homepage, along regular posts

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 › Whitespace: Portfolio projects (Jetpack) also on homepage, along regular posts

This topic is: not resolved

Tagged: custom content types, custom post types, jetpack, portfolio, projects, whitespace

  • This topic has 5 replies, 3 voices, and was last updated 8 years, 4 months ago by fpsdf.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • April 2, 2015 at 11:38 am #146472
    fpsdf
    Member

    I'd like to show portfolio projects (created with Jetpack) on the homepage, just like regular posts. Is this easily achievable through functions.php or by customizing index.php loop?

    Could I even select which projects would show up (using a specific category for that, for example)?

    Thank you so much!

    May 11, 2015 at 12:38 pm #151745
    Ginger
    Participant

    Hi Francisco,

    By using Jetpack do you mean you're wanting to show a gallery on your homepage ?


    @gscoolidge | Support Nerd | Website Producer/Tweaker | IDX Integrations | Hosting Options

    May 11, 2015 at 1:50 pm #151767
    fpsdf
    Member

    I'm using Jetpack with Custom Content Type module activated, so that I can add some Portfolio Projects.
    I want to have these projects on my homepage, behaving as regular blog posts (Whitespace theme shows blog posts on the homepage).
    Perhaps filtered with some category, so that I can control which ones will get a place on the homepage.

    I hope this is clear.

    Thank you so much for this.

    Francisco

    May 12, 2015 at 9:36 am #151856
    brock
    Member

    This involves altering the query in the WordPress loop. Thanks and credit goes to Brad Dalton of wpsites for providing this custom query code.

    You will simply copy and paste this into your functions.php file.

    
    add_action( 'pre_get_posts', 'wpsites_add_custom_post_types_to_loop' );
    
    function wpsites_add_custom_post_types_to_loop( $query ) {
    
    if ( is_home() && $query->is_main_query() ) {
    
    $query->set( 'post_type', array( 'jetpack-portfolio' ) );
    
    return $query;
    
        }
    }
    
    May 12, 2015 at 9:56 am #151860
    Ginger
    Participant

    Thank you Brock (and Brad), I did not have a ready answer for this one.


    @gscoolidge | Support Nerd | Website Producer/Tweaker | IDX Integrations | Hosting Options

    May 20, 2015 at 4:46 am #152871
    fpsdf
    Member

    Guys, thank you so much!

    That placed portfolio projects right on the homepage, exactly as I intended.

    Is there something I can add to this code, so that I can filter it by category? Let's say I only want projects with the category "special" on the homepage?

    Thank you, once more. This is great.

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

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