Skip to content

Instantly share code, notes, and snippets.

@codersaiful
Created April 21, 2024 04:46
Show Gist options
  • Save codersaiful/68d31ef3f02ed1a53f3e13f0e5b1c8a3 to your computer and use it in GitHub Desktop.
Save codersaiful/68d31ef3f02ed1a53f3e13f0e5b1c8a3 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'wpt_archive_layout', 'wpt_custom_archive_layout' );
/**
* Determines the layout for the archive page. Specially for Shop page actually
* First enable from Configuration page.
* See @link https://wooproducttable.com/docs/doc/table-options/product-table-woocommerce-archive-category-tag-attribute-page/
*
* @param string $layout The current view. Available table|grid
* @return string The layout for the archive page. Possible values are 'table' or 'grid'.
* @author Saiful Islam <codersaiful@gmail.com>
*/
function wpt_custom_archive_layout($layout) {
if( is_shop() ) return 'table';
return 'grid';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment