Skip to content

Snippet: Custom Post Type Archive Columns

This snippet shows how you could hook into the "wpex_get_grid_entry_columns" filter to alter the default columns for a post type archive. However, if you are using the Post Types Unlimited plugin you have settings available for this so you don't need to use custom code.

add_filter( 'wpex_get_grid_entry_columns', function( $columns ) {
	if ( 'my_post_type' == get_post_type() ) {
		$columns = 4;
	}
	return $columns;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top