• 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

marcello.vicidomini

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
  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • March 19, 2014 at 7:06 am in reply to: Genesis loop for one category in home #95656
    marcello.vicidomini
    Member

    Because in the front page I have to display other elements too that are not from the category (an image slider), and then I have a different page showing the archive for the category.
    So I thought to have the following structure:
    * home.php: with a sidebar to include the slider as a widget, and a custom loop to show the last 6 posts from “Blog” category
    * A link in the menu pointing to the “Blog” category archive page.

    March 19, 2014 at 6:53 am in reply to: Genesis loop for one category in home #95653
    marcello.vicidomini
    Member

    Ok, that was clear 😀

    Should I use WP_Query instead?

    March 19, 2014 at 6:05 am in reply to: Genesis loop for one category in home #95644
    marcello.vicidomini
    Member

    Hello Brad,
    I think I solved it, here's the code:

    if ( function_exists( 'genesis_grid_loop' ) ) {
    
    	//* Here's the line I added. I used the slug instead of the id, but if works with cat_ID too
    	query_posts('category_name=blog');
    
    	genesis_grid_loop( array(
    		'features' => 0,
    		'feature_image_size' => 0,
    		'feature_image_class' => 'alignleft post-image',
    		'feature_content_limit' => 200,
    		'grid_image_size' => 'homepage-featured-image',
    		'grid_image_class' => 'alignleft post-image',
    		'grid_content_limit' => 0,
    	) );
    } else {
    	genesis_standard_loop();
    }
    March 19, 2014 at 6:00 am in reply to: How to override number of posts per page settings with the loop? #95640
    marcello.vicidomini
    Member

    Hello Anitac, thanks for yor answer.

    I downloaded the sample child theme and I'm customizing it.
    As for the url, I'm sorry I didn't post one, but it's still in development and unfortunately I have to keep it password protected. I'll make sure I'll share the url with you for feedback as soon as it goes live 😀

    Anyway, I think I found a solution. Here's the code I wrote:

    if ( function_exists( 'genesis_grid_loop' ) ) {
    	
    	//* Here's the line I added
    	query_posts('posts_per_page=6;');
    	
    	genesis_grid_loop( array(
    		'features' => 0,
    		'feature_image_size' => 0,
    		'feature_image_class' => 'alignleft post-image',
    		'feature_content_limit' => 200,
    		'grid_image_size' => 'homepage-featured-image',
    		'grid_image_class' => 'alignleft post-image',
    		'grid_content_limit' => 0,
    	) );
    } else {
    	genesis_standard_loop();
    }

    It seems to have done the trick! 😀

    March 17, 2014 at 2:43 am in reply to: Genesis loop for one category in home #95256
    marcello.vicidomini
    Member

    Hello braddalton,

    thanks a lot for your answer!
    Don't you think that pre_get_posts would be impractical? It looks like each time you add a new category you have to edit the code. Or maybe I'm not getting something? Isn't there a way to include one category rather then excluding all the other ones?

    Thanks again for your help 😀

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)

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