simple changes, fixed some issues
This commit is contained in:
@ -72,9 +72,9 @@ add_action( 'wp_head', 'sophia_after_dark_pingback_header' );
|
||||
if ( ! function_exists( 'sophia_after_dark_fonts_url' ) ) :
|
||||
|
||||
/**
|
||||
* Register Google fonts for Sophia After Dark.
|
||||
* Register Bunny fonts for Sophia After Dark.
|
||||
*
|
||||
* @return string Google fonts URL for the theme.
|
||||
* @return string Bunny fonts URL for the theme.
|
||||
* @since 1.0.0
|
||||
*/
|
||||
function sophia_after_dark_fonts_url() {
|
||||
@ -132,56 +132,43 @@ function sophia_after_dark_admin_scripts( $hook ) {
|
||||
/**
|
||||
* Enqueue scripts and styles.
|
||||
*/
|
||||
function sophia_after_dark_scripts() {
|
||||
global $sophia_after_dark_theme_version;
|
||||
function sophia_after_dark_scripts(): void {
|
||||
$v = wp_get_theme()->get('Version');
|
||||
$dir = get_template_directory_uri();
|
||||
|
||||
wp_enqueue_style( 'sophia-after-dark-fonts', sophia_after_dark_fonts_url(), array(), null );
|
||||
wp_enqueue_style( 'lightslider-style', get_template_directory_uri() .'/assets/library/lightslider/css/lightslider.min.css', array(), '' );
|
||||
wp_enqueue_style( 'animate', get_template_directory_uri(). '/assets/library/animate/animate.min.css', array(), '3.5.1' );
|
||||
wp_enqueue_style( 'sophia-after-dark-style', get_stylesheet_uri(), array(), esc_attr( $sophia_after_dark_theme_version) );
|
||||
wp_enqueue_style( 'sophia-after-dark-responsive-style', get_template_directory_uri(). '/assets/css/mt-responsive.css', array(), esc_attr( $sophia_after_dark_theme_version ) );
|
||||
wp_enqueue_style('sophia-after-dark-fonts', sophia_after_dark_fonts_url(), [], null);
|
||||
wp_enqueue_style('lightslider-style', "$dir/assets/library/lightslider/css/lightslider.min.css", [], null);
|
||||
wp_enqueue_style('animate', "$dir/assets/library/animate/animate.min.css", [], '3.5.1');
|
||||
wp_enqueue_style('sophia-after-dark-style', get_stylesheet_uri(), [], $v);
|
||||
wp_enqueue_style('sophia-after-dark-responsive-style', "$dir/assets/css/mt-responsive.css", [], $v);
|
||||
|
||||
wp_enqueue_script( 'sophia-after-dark-combine-scripts', get_template_directory_uri() .'/assets/js/mt-combine-scripts.js', array('jquery'), esc_attr( $sophia_after_dark_theme_version ), true );
|
||||
wp_enqueue_script( 'sophia-after-dark-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), esc_attr( $sophia_after_dark_theme_version ), true );
|
||||
wp_enqueue_script( 'sophia-after-dark-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), esc_attr( $sophia_after_dark_theme_version ), true );
|
||||
wp_enqueue_script( 'sophia-after-dark-custom-scripts', get_template_directory_uri() .'/assets/js/mt-custom-scripts.js', array('jquery'), esc_attr( $sophia_after_dark_theme_version ), true );
|
||||
wp_enqueue_script('sophia-after-dark-combine-scripts', "$dir/assets/js/mt-combine-scripts.js", ['jquery'], $v, true);
|
||||
wp_enqueue_script('sophia-after-dark-navigation', "$dir/assets/js/navigation.js", [], $v, true);
|
||||
wp_enqueue_script('sophia-after-dark-skip-link-focus-fix', "$dir/assets/js/skip-link-focus-fix.js", [], $v, true);
|
||||
wp_enqueue_script('sophia-after-dark-custom-scripts', "$dir/assets/js/mt-custom-scripts.js", ['jquery'], $v, true);
|
||||
|
||||
$sophia_after_dark_enable_sticky_menu = get_theme_mod( 'sophia_after_dark_enable_sticky_menu', true );
|
||||
if ( true === $sophia_after_dark_enable_sticky_menu ) {
|
||||
$sticky_value = 'on';
|
||||
} else {
|
||||
$sticky_value = 'off';
|
||||
}
|
||||
wp_localize_script('sophia-after-dark-custom-scripts', 'sophia_after_darkObject', [
|
||||
'menu_sticky' => get_theme_mod('sophia_after_dark_enable_sticky_menu', true) ? 'on' : 'off',
|
||||
'wow_effect' => get_theme_mod('sophia_after_dark_enable_wow_animation', true) ? 'on' : 'off',
|
||||
]);
|
||||
|
||||
$sophia_after_dark_enable_wow_animation = get_theme_mod( 'sophia_after_dark_enable_wow_animation', true );
|
||||
if ( true === $sophia_after_dark_enable_wow_animation ) {
|
||||
$wow_value = 'on';
|
||||
} else {
|
||||
$wow_value = 'off';
|
||||
}
|
||||
|
||||
wp_localize_script( 'sophia-after-dark-custom-scripts', 'sophia_after_darkObject', array(
|
||||
'menu_sticky' => $sticky_value,
|
||||
'wow_effect' => $wow_value
|
||||
) );
|
||||
|
||||
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
||||
wp_enqueue_script( 'comment-reply' );
|
||||
if (is_singular() && comments_open() && get_option('thread_comments')) {
|
||||
wp_enqueue_script('comment-reply');
|
||||
}
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'sophia_after_dark_scripts' );
|
||||
add_action('wp_enqueue_scripts', 'sophia_after_dark_scripts');
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
if ( ! function_exists( 'sophia_after_dark_font_awesome_social_icon_array' ) ) :
|
||||
if ( ! function_exists( 'sophia_after_dark_fork_awesome_social_icon_array' ) ) :
|
||||
|
||||
/**
|
||||
* Define font awesome social media icons
|
||||
* Define fork awesome social media icons
|
||||
*
|
||||
* @return array();
|
||||
* @since 1.0.0
|
||||
*/
|
||||
function sophia_after_dark_font_awesome_social_icon_array() {
|
||||
function sophia_after_dark_fork_awesome_social_icon_array() {
|
||||
return array(
|
||||
"fa fa-facebook-square","fa fa-facebook-f","fa fa-facebook","fa fa-facebook-official","fa fa-twitter-square","fa fa-twitter","fa fa-yahoo","fa fa-google","fa fa-google-wallet","fa fa-google-plus-circle","fa fa-google-plus-official","fa fa-instagram","fa fa-linkedin-square","fa fa-linkedin","fa fa-pinterest-p","fa fa-pinterest","fa fa-pinterest-square","fa fa-google-plus-square","fa fa-google-plus","fa fa-youtube-square","fa fa-youtube","fa fa-youtube-play","fa fa-vimeo","fa fa-vimeo-square",
|
||||
);
|
||||
|
Reference in New Issue
Block a user