if ( ! class_exists( 'Orbius_Base' ) ) {
/**
* Main theme class with configuration
*/
class Orbius_Base {
private static $instance;
public function __construct() {
// Include required files
require_once get_template_directory() . '/constants.php';
require_once (SWM_FUNCTIONS . 'helpers.php');
add_action( 'after_setup_theme', [ $this, 'theme_custom_setup' ] );
// Conact Form 7
if ( defined( 'WPCF7_VERSION' ) ) {
require_once (SWM_TEMPLATE_DIR . '/plugins/contact-form-7/contact-form-7.php');
}
// WooCommerce
if ( SWM_WOOCOMMERCE_IS_ACTIVE ) {
include_once (SWM_WOOCOMMERCE . 'class-custom-woocommerce.php');
}
// One Click Demo Import
if ( SWM_ONE_CLICK_DEMO_IMPORT ) {
require_once (SWM_TEMPLATE_DIR . '/plugins/one-click-demo-import/swm-one-click-demo-import.php');
}
}
public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
public function theme_custom_setup(){
include_once (SWM_CUSTOMIZER . 'customizer.php');
include_once (SWM_ADMIN . 'admin.php');
foreach ( glob( SWM_INCLUDES . '*.php' ) as $file ) {
include_once $file;
}
// Polylang support
if ( class_exists( 'Polylang' ) && apply_filters( 'swm_polylang_support', true ) ) {
require_once SWM_PLUGINS . 'class-polylang.php';
}
add_action( 'wp_enqueue_scripts', array($this,'load_scripts') );
add_action( 'wp_enqueue_scripts', array($this,'load_styles') );
load_theme_textdomain( 'orbius', get_template_directory().'/languages/' );
}
public function load_styles(){
if ( get_theme_mod( 'swm_theme_fonts', 'google' ) == 'google' ) {
$swm_final_google_body_font = swm_google_fonts_query( get_theme_mod( 'swm_google_body_font_name', 'Poppins' ) );
$swm_final_google_body_font_weight = swm_google_fonts_final_weight( get_theme_mod( 'swm_google_body_font_weight', '500' ) );
$swm_final_google_headings_font = swm_google_fonts_query( get_theme_mod( 'swm_google_headings_font_name', 'Poppins' ) );
$swm_final_google_heading_font_weight = swm_google_fonts_final_weight( get_theme_mod( 'swm_google_headings_font_weight', '600' ) );
$swm_final_google_secondary_font = swm_google_fonts_query( get_theme_mod( 'swm_google_secondary_font_name', 'Roboto Mono' ) );
$swm_final_google_secondary_font_weight = swm_google_fonts_final_weight( get_theme_mod( 'swm_google_secondary_font_weight', '400' ) );
$swm_google_font_subsets = 'latin,latin-ext';
if ( get_theme_mod( 'swm_google_fonts_subset_on', 'off' ) == 'on' ) {
if ( get_theme_mod( 'swm_google_font_subset_cyrillic', 'off' ) == 'on' ) { $swm_google_font_subsets .= ',cyrillic,cyrillic-ext'; }
if ( get_theme_mod( 'swm_google_font_subset_greek', 'off' ) == 'on' ) { $swm_google_font_subsets .= ',greek,greek-ext'; }
if ( get_theme_mod( 'swm_google_font_subset_vietnamese', 'off' ) == 'on' ) { $swm_google_font_subsets .= ',vietnamese'; }
}
$swm_custom_font_args = array(
'family' =>
$swm_final_google_body_font . ':' . $swm_final_google_body_font_weight . ',' . $swm_final_google_body_font_weight . swm_get_selector_font_all_weight('body') . '|' .
$swm_final_google_headings_font . ':' . $swm_final_google_heading_font_weight . ',' . $swm_final_google_heading_font_weight . swm_get_selector_font_all_weight('headings') . '|' .
$swm_final_google_secondary_font . ':' . $swm_final_google_secondary_font_weight . ',' . $swm_final_google_secondary_font_weight
.'&display=swap', 'subset' => $swm_google_font_subsets
);
$swm_get_custom_font_family = add_query_arg( $swm_custom_font_args, '//fonts.googleapis.com/css' );
wp_enqueue_style( 'swm-google-fonts', $swm_get_custom_font_family, NULL, SWM_THEME_VERSION, 'all' );
} elseif ( get_theme_mod( 'swm_theme_fonts', 'google' ) == 'adobe' ) {
$swm_adobe_body_font_css_url = esc_url(get_theme_mod( 'swm_adobe_body_font_css_url' ));
if (!empty($swm_adobe_body_font_css_url)) {
wp_enqueue_style( 'swm-adobe-fonts', $swm_adobe_body_font_css_url, NULL, SWM_THEME_VERSION, 'all' );
}
$swm_adobe_heading_font_css_url = esc_url(get_theme_mod( 'swm_adobe_heading_font_css_url' ));
if (!empty($swm_adobe_heading_font_css_url)) {
wp_enqueue_style( 'swm-adobe-heading-fonts', $swm_adobe_heading_font_css_url, NULL, SWM_THEME_VERSION, 'all' );
}
$swm_adobe_secondary_font_css_url = esc_url(get_theme_mod( 'swm_adobe_secondary_font_css_url' ));
if (!empty($swm_adobe_secondary_font_css_url)) {
wp_enqueue_style( 'swm-adobe-secondary-fonts', $swm_adobe_secondary_font_css_url, NULL, SWM_THEME_VERSION, 'all' );
}
}
// Google Fonts End
// Enqueue Theme CSS Files
wp_enqueue_style( 'font-awesome-free', get_template_directory_uri() . '/webfonts/font-awesome.min.css', '', SWM_THEME_VERSION );
if ( swm_customizer_metabox_onoff('swm_display_header','swm_meta_display_header','default','default') == 'default' ) {
wp_enqueue_style( 'swm-header-style', SWM_THEME_CSS . 'header.css', '', SWM_THEME_VERSION );
}
if ( swm_customizer_metabox_onoff('swm_display_footer','swm_meta_display_footer','default','default') == 'default' ) {
wp_enqueue_style( 'swm-footer-style', SWM_THEME_CSS . 'footer.css', '', SWM_THEME_VERSION );
}
// main.css
wp_enqueue_style( 'swm-main', SWM_THEME_CSS . 'main.css', '', SWM_THEME_VERSION );
}
public function load_scripts(){
if (!is_admin()) {
wp_enqueue_script( 'imagesloaded' );
wp_enqueue_script( 'fitVids', SWM_THEME_DIR . '/js/fitvids.min.js', ['jquery'],SWM_THEME_VERSION, TRUE );
wp_enqueue_script( 'magnific-popup', SWM_THEME_DIR . '/js/magnific-popup.min.js', ['jquery'],SWM_THEME_VERSION, TRUE );
wp_enqueue_script( 'swm-main', SWM_THEME_DIR . '/js/main.js', ['jquery'],SWM_THEME_VERSION, TRUE );
if ( get_theme_mod('swm_sticky_sidebar_on','on') == 'on') {
wp_enqueue_script( 'theia-sticky-sidebar', SWM_THEME_DIR . '/js/theia-sticky-sidebar.min.js', ['jquery'],SWM_THEME_VERSION, TRUE );
}
//Localize scripts
$swmStickyFooterOn = get_theme_mod('swm_sticky_footer_on','off');
$swm_meta_sticky_footer_on = get_post_meta( swm_get_queried_object_id(), 'swm_meta_sticky_footer_on', true );
if ( !empty($swm_meta_sticky_footer_on) && isset($swm_meta_sticky_footer_on) ) {
if ( 'default' != $swm_meta_sticky_footer_on ) {
$swmStickyFooterOn = $swm_meta_sticky_footer_on;
}
}
$swmJsOptions = array(
'stickyDisableResolution' => get_theme_mod( 'swm_sticky_footer_disable', 979 ),
'swmStickyFooterOn' => $swmStickyFooterOn
);
wp_localize_script( 'swm-main', 'swmJSOptions', $swmJsOptions );
}
}
}
Orbius_Base::get_instance();
}
Warning: Cannot modify header information - headers already sent by (output started at /home/xlyqg2d1qbng/public_html/sirius-scapes.com/wp-content/themes/orbius/functions.php:1) in /home/xlyqg2d1qbng/public_html/sirius-scapes.com/wp-includes/pluggable.php on line 1531
Warning: Cannot modify header information - headers already sent by (output started at /home/xlyqg2d1qbng/public_html/sirius-scapes.com/wp-content/themes/orbius/functions.php:1) in /home/xlyqg2d1qbng/public_html/sirius-scapes.com/wp-includes/pluggable.php on line 1534