• 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

Grid Format in a 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 › Design Tips and Tricks › Grid Format in a Page

This topic is: resolved

Tagged: grid

  • This topic has 5 replies, 2 voices, and was last updated 5 years, 9 months ago by gucu.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • September 7, 2017 at 9:14 am #211188
    gucu
    Participant

    Hi All

    I have just made a page template using the following code:

    <?php
     
    //* Template Name: Blog
    //* Show page content above posts
    add_action( 'genesis_loop', 'genesis_standard_loop', 5 );
     
    genesis();

    And then to assign a category using:

    query_args cat=

    What I would love to do is display the output as a grid with the title overlaying the featured image.

    Is that possible please?

    Thanks

    Rich

    http://makery.co.uk.gridhosted.co.uk/diy-test-page/
    September 7, 2017 at 9:18 am #211189
    Brad Dalton
    Participant

    Which layout are you using? Full width or content sidebar?

    You can use PHP code to display posts in columns or CSS


    Tutorials for StudioPress Themes & WooCommerce.

    September 7, 2017 at 9:34 am #211190
    gucu
    Participant

    Content sidebar

    Thanks

    Rich

    September 8, 2017 at 3:04 am #211212
    gucu
    Participant

    Hi

    Thanks for the reply. I am using the content and sidebar layout.

    I have had a look through those codes and am unsure of where to go. I tried yesterday and it didn't go well - just kept coming up with a blank page.

    Thanks

    Rich

    September 8, 2017 at 3:10 am #211213
    Brad Dalton
    Participant

    Did you add this code? https://www.billerickson.net/a-better-and-easier-grid-loop/


    Tutorials for StudioPress Themes & WooCommerce.

    September 8, 2017 at 3:26 am #211215
    gucu
    Participant

    Hi

    I added the code:
    http://makery.co.uk.gridhosted.co.uk/diy-test-page/

    Here is the code I have:

    <?php
     
    //* Template Name: Grid
    //* Show page content above posts
    
    function be_archive_post_class( $classes ) {
    	global $wp_query;
    	if( ! $wp_query->is_main_query() )
    		return $classes;
    		
    	$classes[] = 'one-third';
    	if( 0 == $wp_query->current_post % 3 )
    		$classes[] = 'first';
    	return $classes;
    }
    add_filter( 'post_class', 'be_archive_post_class' );

    Thanks for the help.

    Rich

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

© 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