This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Tagged: ,

Post Grid Columns for Archives

  • Creator
    Topic
  • #14141
    askwpgirl
    Participant

    Hi Jason,

    This should be so easy, but I’m making it hard. I want ALL the category, etc., archives on a site to show as a post grid. Easy. Use the themeblvd_template_parts filter. However, I can’t control the number of columns. It defaults to 3 columns, and I’d like it to be 2 columns. It seems I would need to hack the archive.php and content-grid.php files to get the correct HTML to output for 2 columns instead of 3.

    Thanks! Anchorage has been warm lately. Compared to here, anyway.

    Angela

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #14149
    srumery
    Participant

    Hello askwpgirl,

    I had a similar requirement recently to alter the grid columns and this is what worked for me. This one is for a specific post type but you get the idea…

    // conditionally modify the number of grid columns 
    function rum_member_grid_columns() {
    	// set the number of columns for the member archive page
    	if ( is_archive() && 'members' == get_post_type() ) {
    		    return 4;
    	}
    }
    add_filter( 'themeblvd_default_grid_columns', 'rum_member_grid_columns' );

    For two columns, you may need to return 6;. I think that will give you a 50/50 layout. Give it a try!

    #14153
    Jason Bobich
    Keymaster

    Yup, that’s the one! Checkout the “Useful Tidbits” section towards the bottom of the article here:

    http://dev.themeblvd.com/tutorial/grid-mode-adjusting-post-archives-to-display-in-a-grid/

    Is all that working for you, Angela?

    And FYI, I’m actually in New York right now. I’m playing hockey this year again and I got traded from Danville, IL to Watertown, NY just on Friday. I arrived here and they have frickn snow blizzards going on. It’s a mess!

    #14164
    askwpgirl
    Participant

    Jason, that’s beautiful! The filter for the columns is what I needed. I just didn’t have that handy anywhere. Thanks!

    Good luck on the hockey! Yes, the East coast is a mess. How awesome you play. Hockey rocks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.