// Check if WooCommerce is active
function themeslot_check_woocommerce() {
if ( ! class_exists( 'WooCommerce' ) ) {
add_action( 'admin_notices', function() {
echo '
Category Folder Shortcode requires WooCommerce to be installed and activated.
';
});
return false;
}
return true;
}
// Shortcode to display categories as folders
function themeslot_category_folder_shortcode( $atts ) {
if ( ! themeslot_check_woocommerce() ) return '';
$atts = shortcode_atts( array(
'name' => '',
'color' => '#FFD700', // Default folder color (Gold)
'hover' => '#FFA500' // Default hover color (Orange)
), $atts );
$category_name = sanitize_text_field( $atts['name'] );
if ( empty( $category_name ) ) return '';
$folder_color = sanitize_hex_color( $atts['color'] ) ?: '#FFD700';
$hover_color = sanitize_hex_color( $atts['hover'] ) ?: '#FFA500';
// Get category object
$category = get_term_by( 'name', $category_name, 'product_cat' );
if ( ! $category ) return '';
// Get category link
$category_link = get_term_link( $category );
// Folder display with new SuperNATURAL/SuperNOVA effect
$output = '
';
}
}
add_action( 'woocommerce_after_main_content', 'themeslot_subcategories_only', 20 );
// Plugin styles with SuperNATURAL/SuperNOVA effect
function themeslot_category_folder_styles() {
echo '
';
}
add_action( 'wp_head', 'themeslot_category_folder_styles' );
Warning: Cannot modify header information - headers already sent by (output started at /home/u859619147/domains/techfixa.com/public_html/wp-content/plugins/category-folder-shortcode-1/category-folder-shortcode.php:1) in /home/u859619147/domains/techfixa.com/public_html/wp-content/plugins/download-monitor/src/DownloadHandler.php on line 488
Warning: session_start(): Session cannot be started after headers have already been sent in /home/u859619147/domains/techfixa.com/public_html/wp-content/plugins/download-monitor/src/DLM.php on line 956 cart - TECHFIXASkip to content