Server IP : 104.21.14.48 / Your IP : 3.149.235.108 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/themes/CubicWP/inc/functions/ |
Upload File : |
<?php /** * Css Classes Functions * * @package ListMode WordPress Theme * @copyright Copyright (C) 2024 ThemesDNA * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later * @author ThemesDNA <[email protected]> */ class ListMode_CSS { public function __construct() { add_filter('post_class', array($this, 'add_category_id_class')); add_filter('body_class', array($this, 'add_body_classes')); } public function add_category_id_class($classes) { global $post; foreach((get_the_category($post->ID)) as $category) { $classes[] = 'wpcat-' . $category->cat_ID . '-id'; } return $classes; } public function add_body_classes($classes) { $layout_instance = ListMode_Layout::get_instance(); if ( is_multi_author() ) { $classes[] = 'listmode-group-blog'; } if ( !(listmode_get_option('disable_loading_animation')) ) { $classes[] = 'listmode-animated listmode-fadein'; } $classes[] = 'listmode-theme-is-active'; if ( get_header_image() ) { $classes[] = 'listmode-header-image-active'; } if ( listmode_get_option('header_image_cover') ) { $classes[] = 'listmode-header-image-cover'; } if ( has_custom_logo() ) { $classes[] = 'listmode-custom-logo-active'; } if ( is_singular() ) { $classes[] = 'listmode-singular-page'; } else { $classes[] = 'listmode-non-singular-page'; } if ( is_singular() ) { if( is_single() ) { if ( listmode_get_option('featured_media_under_post_title') ) { $classes[] = 'listmode-single-media-under-title'; } } if( is_page() ) { if ( listmode_get_option('featured_media_under_page_title') ) { $classes[] = 'listmode-single-media-under-title'; } } if ( is_page_template( array( 'template-full-width-page.php', 'template-full-width-post.php' ) ) ) { $classes[] = 'listmode-layout-full-width'; } else { $classes[] = 'listmode-layout-c-s1'; } } else { $classes[] = 'listmode-layout-full-width'; } if ( (!($layout_instance->is_primary_menu_active()) && !($layout_instance->is_social_buttons_active())) ) { $classes[] = 'listmode-header-layout-fullwidth'; } else { $classes[] = 'listmode-header-layout-branding-menu-social'; } if ( listmode_get_option('hide_tagline') ) { $classes[] = 'listmode-tagline-inactive'; } if ( 'beside-title' === listmode_get_option('logo_location') ) { $classes[] = 'listmode-logo-beside-title'; } elseif ( 'above-title' === listmode_get_option('logo_location') ) { $classes[] = 'listmode-logo-above-title'; } else { $classes[] = 'listmode-logo-above-title'; } if ( listmode_is_woocommerce_activated() ) { if ( listmode_get_option('woocommerce_full_width') ) { $classes[] = 'listmode-woocommerce-full-width'; } } if ( $layout_instance->is_primary_menu_active() ) { $classes[] = 'listmode-primary-menu-active'; } else { $classes[] = 'listmode-primary-menu-inactive'; } $classes[] = 'listmode-primary-mobile-menu-active'; $classes[] = 'listmode-table-css-active'; return $classes; } } $listmode_css_classes = new ListMode_CSS();