moved call to script to inc, cleaner structure
This commit is contained in:
parent
a7e4455e73
commit
7fe9ffc741
|
@ -127,31 +127,8 @@ require get_template_directory() . '/inc/widgets-register.php';
|
||||||
/**
|
/**
|
||||||
* Enqueue scripts and styles.
|
* Enqueue scripts and styles.
|
||||||
*/
|
*/
|
||||||
function xarxaprod_theme_scripts() {
|
|
||||||
wp_enqueue_style( 'xarxaprod-style', get_stylesheet_uri(), array(), _S_VERSION );
|
|
||||||
//https://developer.wordpress.org/reference/functions/wp_enqueue_style/#comment-2056
|
|
||||||
//wp_enqueue_style('main-styles', get_template_directory_uri() . '/css/style.css', array(), filemtime(get_template_directory() . '/css/style.css'), false);
|
|
||||||
//wp_enqueue_style( 'xarxaprod-style', get_stylesheet_uri(), array(), filemtime(get_stylesheet_uri() . 'style.css'), false);
|
|
||||||
wp_style_add_data( 'xarxaprod-style', 'rtl', 'replace' );
|
|
||||||
|
|
||||||
// https://stackoverflow.com/a/24994304
|
require get_template_directory() . '/inc/theme-css-scripts.php';
|
||||||
// deregister default jQuery included with Wordpress
|
|
||||||
//wp_deregister_script( 'jquery' );
|
|
||||||
// register our jQuery minified from theme directory
|
|
||||||
//wp_enqueue_script('jquery', get_template_directory_uri().'/js/jquery.min.js', array(),'3.7.1',true);
|
|
||||||
|
|
||||||
// navigation scripts
|
|
||||||
wp_enqueue_script( 'xarxaprod-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true );
|
|
||||||
|
|
||||||
// scroll detection script
|
|
||||||
// https://css-tricks.com/styling-based-on-scroll-position/
|
|
||||||
wp_enqueue_script( 'xarxaprod-scrollposition', get_template_directory_uri() . '/js/scrollposition.js', array(), _S_VERSION, true );
|
|
||||||
|
|
||||||
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
|
||||||
wp_enqueue_script( 'comment-reply' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
add_action( 'wp_enqueue_scripts', 'xarxaprod_theme_scripts' );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement the Custom Header feature.
|
* Implement the Custom Header feature.
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Enqueue scripts and styles.
|
||||||
|
*/
|
||||||
|
if ( ! function_exists( 'xarxaprod_theme_css_scripts' ) ){
|
||||||
|
function xarxaprod_theme_css_scripts() {
|
||||||
|
wp_enqueue_style( 'xarxaprod-style', get_stylesheet_uri(), array(), _S_VERSION );
|
||||||
|
//https://developer.wordpress.org/reference/functions/wp_enqueue_style/#comment-2056
|
||||||
|
//wp_enqueue_style('main-styles', get_template_directory_uri() . '/css/style.css', array(), filemtime(get_template_directory() . '/css/style.css'), false);
|
||||||
|
//wp_enqueue_style( 'xarxaprod-style', get_stylesheet_uri(), array(), filemtime(get_stylesheet_uri() . 'style.css'), false);
|
||||||
|
wp_style_add_data( 'xarxaprod-style', 'rtl', 'replace' );
|
||||||
|
|
||||||
|
// https://stackoverflow.com/a/24994304
|
||||||
|
// deregister default jQuery included with Wordpress
|
||||||
|
//wp_deregister_script( 'jquery' );
|
||||||
|
// register our jQuery minified from theme directory
|
||||||
|
//wp_enqueue_script('jquery', get_template_directory_uri().'/js/jquery.min.js', array(),'3.7.1',true);
|
||||||
|
|
||||||
|
// navigation scripts
|
||||||
|
wp_enqueue_script( 'xarxaprod-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true );
|
||||||
|
|
||||||
|
// scroll detection script
|
||||||
|
// https://css-tricks.com/styling-based-on-scroll-position/
|
||||||
|
wp_enqueue_script( 'xarxaprod-scrollposition', get_template_directory_uri() . '/js/scrollposition.js', array(), _S_VERSION, true );
|
||||||
|
|
||||||
|
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
||||||
|
wp_enqueue_script( 'comment-reply' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_action( 'wp_enqueue_scripts', 'xarxaprod_theme_css_scripts' );
|
Loading…
Reference in New Issue