• 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

Digital Pro : add pages and custom posts into the loop ?

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 › Digital Pro : add pages and custom posts into the loop ?

This topic is: resolved

Tagged: Custom Post Type, loop

  • This topic has 3 replies, 2 voices, and was last updated 9 years ago by tatziki.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • May 13, 2016 at 2:58 am #185548
    tatziki
    Member

    Hello,

    I'd like to display pages and custom post in the front page.
    Currently, only blog posts are included.
    Could someone explain me how to change the original loop ?
    Perhaps is it better to create another custom one ?

    Thanks a lot for any help.
    Charlotte

    May 13, 2016 at 3:28 am #185549
    Victor Font
    Moderator

    You need something like this in your functions.php file:

    function vmf_query_filter($query) {
    	if ( ! is_admin() && $query->is_main_query() && $query->is_home() ) {
    		$query->set( 'post_type', array('post', 'page', 'portfolio', 'product') );
    	};
    	return $query;
    };
    add_filter('pre_get_posts', 'vmf_query_filter');

    Change portfolio and product in the code, to your CPTs.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 13, 2016 at 4:34 am #185557
    tatziki
    Member

    Merveilleux Victor !!
    Thanks a lot !!

    May 13, 2016 at 5:17 am #185560
    tatziki
    Member
    This reply has been marked as private.
  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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