parent()->get('Version'));
wp_enqueue_style( 'aster-gym-trainer-style', get_stylesheet_uri(), array( $aster_gym_trainer_parentcss ), $aster_gym_trainer_theme->get('Version'));
// RTL style.
wp_style_add_data('aster-gym-trainer-style', 'rtl', 'replace');
wp_enqueue_script( 'comment-reply', '/wp-includes/js/comment-reply.min.js', array(), false, true );
}
add_action( 'wp_enqueue_scripts', 'aster_gym_trainer_enqueue_styles' );
if ( ! function_exists( 'aster_gym_trainer_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function aster_gym_trainer_setup() {
load_theme_textdomain( 'aster-gym-trainer', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded
tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
'style',
'script',
'woocommerce',
)
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'aster_gym_trainer_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support(
'custom-logo',
array(
'height' => 250,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
)
);
/**
* Add theme support for gutenberg block.
*/
add_theme_support( 'align-wide' );
add_theme_support( 'responsive-embeds' );
if ( ! defined( 'DARK_FITNESS_UPSELL_LINK' ) ) {define('DARK_FITNESS_UPSELL_LINK',__('https://asterthemes.com/products/gym-wordpress-theme','aster-gym-trainer'));}
if ( ! defined( 'DARK_FITNESS_DOC_LINK' ) ) {define('DARK_FITNESS_DOC_LINK',__('https://demo.asterthemes.com/docs/gym-trainer-free','aster-gym-trainer'));}
if ( ! defined( 'DARK_FITNESS_UPSELL_TEXT' ) ) {define( 'DARK_FITNESS_UPSELL_TEXT', __( 'GYM Trainer Pro','aster-gym-trainer' ));}
if ( ! defined( 'DARK_FITNESS_UPSELL_DOC_TEXT' ) ) {define( 'DARK_FITNESS_UPSELL_DOC_TEXT', __( 'Documentation','aster-gym-trainer' ));}
if ( ! defined( 'DARK_FITNESS_UPSELL_COLOR' ) ) {define( 'DARK_FITNESS_UPSELL_COLOR', __( '#fb5b21','aster-gym-trainer' ));}
if ( ! defined( 'DARK_FITNESS_DEMO_URL' ) ) {define('DARK_FITNESS_DEMO_URL',__('https://demo.asterthemes.com/aster-gym-trainer','aster-gym-trainer'));}
if ( ! defined( 'DARK_FITNESS_SUPPORT_URL' ) ) {define('DARK_FITNESS_SUPPORT_URL',__('https://wordpress.org/support/theme/aster-gym-trainer','aster-gym-trainer'));}
if ( ! defined( 'DARK_FITNESS_REVIEW_URL' ) ) {define('DARK_FITNESS_REVIEW_URL',__('https://wordpress.org/support/theme/aster-gym-trainer/reviews/#new-post','aster-gym-trainer'));}
if ( ! defined( 'DARK_FITNESS_PRO_DOC_URL' ) ) {define('DARK_FITNESS_PRO_DOC_URL',__('https://demo.asterthemes.com/docs/aster-gym-trainer-pro','aster-gym-trainer'));}
if ( ! defined( 'DARK_FITNESS_FREE_DOC_URL' ) ) {define('DARK_FITNESS_FREE_DOC_URL',__('https://demo.asterthemes.com/docs/aster-gym-trainer-free','aster-gym-trainer'));}
if ( ! defined( 'DARK_FITNESS_DEMO_IMPORT_URL' ) ) {define('DARK_FITNESS_DEMO_IMPORT_URL',__('themes.php?page=astergymtrainer-wizard','aster-gym-trainer'));}
if ( ! defined( 'DARK_FITNESS_WELCOME_MESSAGE' ) ) {
define( 'DARK_FITNESS_WELCOME_MESSAGE', __( 'Welcome to Aster Gym Trainer', 'aster-gym-trainer' ) );
}
}
endif;
add_action( 'after_setup_theme', 'aster_gym_trainer_setup' );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function aster_gym_trainer_widgets_init() {
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'aster-gym-trainer' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'aster-gym-trainer' ),
'before_widget' => '',
'before_title' => '',
)
);
}
add_action( 'widgets_init', 'aster_gym_trainer_widgets_init' );
function aster_gym_trainer_output_footer_copyright_content() {
$dark_fitness_theme_data = wp_get_theme();
$dark_fitness_search = array( '[the-year]', '[site-link]' );
$dark_fitness_replace = array( date( 'Y' ) );
/* translators: 1: Year, 2: Site Title with home URL. */
$dark_fitness_copyright_default = sprintf( esc_html_x( ' %1$s %2$s', '1: Year, 2: Site Title with home URL', 'aster-gym-trainer' ), '[the-year]', '[site-link]' );
$dark_fitness_copyright_text = get_theme_mod( 'dark_fitness_footer_copyright_text', $dark_fitness_copyright_default );
$dark_fitness_copyright_text = str_replace( $dark_fitness_search, $dark_fitness_replace, $dark_fitness_copyright_text );
$dark_fitness_copyright_text .= ''. esc_html( $dark_fitness_theme_data->get( 'Name' ) ) . '' . ' ' . esc_html__( 'by', 'aster-gym-trainer' ) . ' ' . esc_html( ucwords( $dark_fitness_theme_data->get( 'Author' ) ) ) . '';
/* translators: %s: WordPress.org URL */
$dark_fitness_copyright_text .= sprintf( esc_html__( ' | Powered by %s', 'aster-gym-trainer' ), 'WordPress. ' );
?>
add_setting(
'primary_color',
array(
'default' => $aster_gym_trainer_default_color,
'sanitize_callback' => 'sanitize_hex_color',
)
);
// Add control for primary color
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'primary_color',
array(
'label' => __( 'Primary Color', 'dark-fitness' ),
'section' => 'colors',
'priority' => 5,
)
)
);
}
add_action( 'customize_register', 'dark_fitness_customize_register_color' );