• 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

Using different grids on multiple category 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 › Using different grids on multiple category page

This topic is: resolved

Tagged: category, custom, grid, layout

  • This topic has 14 replies, 3 voices, and was last updated 11 years, 3 months ago by Genesis Developer.
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • August 14, 2014 at 1:55 pm #118849
    Marijn
    Participant

    Hi all!

    I've been looking everywhere and it seems impossible.... So my last hope..

    I really want one of my category pages to have a different grid then the other category pages. Is this somehow doable??

    I got like 5 category pages which are ok with the same grid look but now I made one category page on which logged-in users can post their own posts. But I want to have that category page look like sort of pinterest style, or just with 4 or 5 featured posts on a row..

    Hope that someone can help me out!! Would be very much appreciated!
    (oh.. and I'm not a programmer of any kind..)

    August 14, 2014 at 5:20 pm #118866
    Lauren @ OnceCoupled
    Member

    Can you provide a link to your site? That would help with visualizing what you're asking for, and providing a more specific solution.


    We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com

    August 15, 2014 at 4:13 am #118944
    Marijn
    Participant

    HI, thanks for your reply! The link to my blog page is: blog

    So my blog page is showing 7 featured posts and now I want a specific category page to show 9 teasers in 3 columns...

    August 15, 2014 at 6:07 am #118972
    Genesis Developer
    Member
    add_filter('post_class', 'grid_view_post_class');
    function grid_view_post_class( $classes ) {
       if( is_category(ENTER YOUR SPECIFIC CATEGORY ID	HERE)):
            $classes[] = 'one-third';
    	global $wp_query;
    	if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % $columns )
    		$classes[] = 'first';
      endif;
    	return $classes;
    }
    add_action('pre_get_posts', 'post_items');
    function post_items( $query ) {
    	if( $query->is_main_query() && !is_admin() && is_category(ENTER YOUR SPECIFIC CATEGORY ID HERE) ) {
    		$query->set( 'posts_per_page', '9' );
    	}
    }
    

    Add the above code in your functions.php file. Hope that it will help you.


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    August 15, 2014 at 6:40 am #118980
    Marijn
    Participant

    Hi Genwrock,

    Thanks for your reply but that code resulted in an error.. I tried adding the category ID with and without the ' .

    August 15, 2014 at 7:04 am #118989
    Genesis Developer
    Member

    what kind of errors are you fetching?


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    August 15, 2014 at 7:09 am #118990
    Marijn
    Participant

    Had to add the code again to reproduce the error and... now I started with the category between ' and no error.
    I'm sorry for the misunderstanding..

    But I see no changes tot the grid, Do I need to change some more?

    Thanks for your help!

    August 15, 2014 at 7:13 am #118991
    Genesis Developer
    Member

    can you give me category page link (which have grid style)?


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    August 15, 2014 at 7:16 am #118993
    Genesis Developer
    Member

    oops.. I made a mistake. Please replace this line

    if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % $columns )
    

    by

    if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 3)


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    August 15, 2014 at 7:19 am #118995
    Marijn
    Participant

    Changing that line gave me this error:

    Parse error: syntax error, unexpected '&' in /home1/marijnb/public_html/pipstudioservies.nl/wp-content/themes/parallax-pro/functions.php on line 188

    August 15, 2014 at 7:21 am #118996
    Genesis Developer
    Member

    Ok. Use the pastebin.com and put the full code of functions.php file. Next share the link. I'll look it


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    August 15, 2014 at 7:32 am #118999
    Marijn
    Participant

    http://pastebin.com/MQMw4rHv

    After the error I put back the original code you gave me and now it seems to work? So looks like you didn't make a mistake there..

    See here: Link

    August 15, 2014 at 7:39 am #119000
    Genesis Developer
    Member

    Please see the new version here http://pastebin.com/5VQQ7jjB . I modified the code little bit. Before there was a bug.


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    August 15, 2014 at 7:51 am #119001
    Marijn
    Participant

    Thanks so much!! Everything is fine now!

    August 15, 2014 at 7:55 am #119002
    Genesis Developer
    Member

    Ok. Please mark this thread as RESOLVED.


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘Using different grids on multiple category page’ is closed to new 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