Skip to content

Commit 7e40119

Browse files
committed
update cjt assets prirotiy
1 parent 4767121 commit 7e40119

File tree

1 file changed

+190
-190
lines changed

1 file changed

+190
-190
lines changed

functions.php

Lines changed: 190 additions & 190 deletions
Original file line numberDiff line numberDiff line change
@@ -1,190 +1,190 @@
1-
<?php
2-
/**
3-
* cjt functions and definitions
4-
*
5-
* @link https://developer.wordpress.org/themes/basics/theme-functions/
6-
*
7-
* @package cjt
8-
*/
9-
10-
if (! defined('_S_VERSION')) {
11-
// Replace the version number of the theme on each release.
12-
define('_S_VERSION', '1.0.0');
13-
}
14-
15-
/**
16-
* Sets up theme defaults and registers support for various WordPress features.
17-
*
18-
* Note that this function is hooked into the after_setup_theme hook, which
19-
* runs before the init hook. The init hook is too late for some features, such
20-
* as indicating support for post thumbnails.
21-
*/
22-
function cjt_setup()
23-
{
24-
/*
25-
* Make theme available for translation.
26-
* Translations can be filed in the /languages/ directory.
27-
* If you're building a theme based on cjt, use a find and replace
28-
* to change 'cjt' to the name of your theme in all the template files.
29-
*/
30-
load_theme_textdomain('cjt', get_template_directory() . '/languages');
31-
32-
// Add default posts and comments RSS feed links to head.
33-
add_theme_support('automatic-feed-links');
34-
35-
/*
36-
* Let WordPress manage the document title.
37-
* By adding theme support, we declare that this theme does not use a
38-
* hard-coded <title> tag in the document head, and expect WordPress to
39-
* provide it for us.
40-
*/
41-
add_theme_support('title-tag');
42-
43-
/*
44-
* Enable support for Post Thumbnails on posts and pages.
45-
*
46-
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
47-
*/
48-
add_theme_support('post-thumbnails');
49-
50-
// This theme uses wp_nav_menu() in one location.
51-
register_nav_menus(
52-
array(
53-
'menu-1' => esc_html__('Primary', 'cjt'),
54-
)
55-
);
56-
57-
/*
58-
* Switch default core markup for search form, comment form, and comments
59-
* to output valid HTML5.
60-
*/
61-
add_theme_support(
62-
'html5',
63-
array(
64-
'search-form',
65-
'comment-form',
66-
'comment-list',
67-
'gallery',
68-
'caption',
69-
'style',
70-
'script',
71-
)
72-
);
73-
74-
// Set up the WordPress core custom background feature.
75-
add_theme_support(
76-
'custom-background',
77-
apply_filters(
78-
'cjt_custom_background_args',
79-
array(
80-
'default-color' => 'ffffff',
81-
'default-image' => '',
82-
)
83-
)
84-
);
85-
86-
// Add theme support for selective refresh for widgets.
87-
add_theme_support('customize-selective-refresh-widgets');
88-
89-
/**
90-
* Add support for core custom logo.
91-
*
92-
* @link https://codex.wordpress.org/Theme_Logo
93-
*/
94-
add_theme_support(
95-
'custom-logo',
96-
array(
97-
'height' => 250,
98-
'width' => 250,
99-
'flex-width' => true,
100-
'flex-height' => true,
101-
)
102-
);
103-
}
104-
add_action('after_setup_theme', 'cjt_setup');
105-
106-
/**
107-
* Set the content width in pixels, based on the theme's design and stylesheet.
108-
*
109-
* Priority 0 to make it available to lower priority callbacks.
110-
*
111-
* @global int $content_width
112-
*/
113-
function cjt_content_width()
114-
{
115-
$GLOBALS['content_width'] = apply_filters('cjt_content_width', 640);
116-
}
117-
add_action('after_setup_theme', 'cjt_content_width', 0);
118-
119-
/**
120-
* Register widget area.
121-
*
122-
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
123-
*/
124-
function cjt_widgets_init()
125-
{
126-
register_sidebar(
127-
array(
128-
'name' => esc_html__('Sidebar', 'cjt'),
129-
'id' => 'sidebar-1',
130-
'description' => esc_html__('Add widgets here.', 'cjt'),
131-
'before_widget' => '<section id="%1$s" class="widget %2$s">',
132-
'after_widget' => '</section>',
133-
'before_title' => '<h2 class="widget-title">',
134-
'after_title' => '</h2>',
135-
)
136-
);
137-
}
138-
add_action('widgets_init', 'cjt_widgets_init');
139-
140-
/**
141-
* Enqueue scripts and styles.
142-
*/
143-
function cjt_scripts()
144-
{
145-
wp_enqueue_style('cjt-style', get_stylesheet_uri(), array(), _S_VERSION);
146-
147-
wp_enqueue_script('cjt-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), _S_VERSION, true);
148-
wp_enqueue_script('cjt-marquee', get_template_directory_uri() . '/assets/js/marquee.js', array(), _S_VERSION, true);
149-
150-
if (is_singular() && comments_open() && get_option('thread_comments')) {
151-
wp_enqueue_script('comment-reply');
152-
}
153-
}
154-
add_action('wp_enqueue_scripts', 'cjt_scripts', 1);
155-
156-
/**
157-
* Implement the Custom Header feature.
158-
*/
159-
require get_template_directory() . '/inc/custom-header.php';
160-
161-
/**
162-
* Custom template tags for this theme.
163-
*/
164-
require get_template_directory() . '/inc/template-tags.php';
165-
166-
/**
167-
* Functions which enhance the theme by hooking into WordPress.
168-
*/
169-
require get_template_directory() . '/inc/template-functions.php';
170-
171-
/**
172-
* Customizer additions.
173-
*/
174-
require get_template_directory() . '/inc/customizer.php';
175-
176-
/**
177-
* Load Jetpack compatibility file.
178-
*/
179-
if (defined('JETPACK__VERSION')) {
180-
require get_template_directory() . '/inc/jetpack.php';
181-
}
182-
183-
function add_additional_class_on_li($classes, $item, $args)
184-
{
185-
if (isset($args->add_li_class)) {
186-
$classes[] = $args->add_li_class;
187-
}
188-
return $classes;
189-
}
190-
add_filter('nav_menu_css_class', 'add_additional_class_on_li', 1, 3);
1+
<?php
2+
/**
3+
* cjt functions and definitions
4+
*
5+
* @link https://developer.wordpress.org/themes/basics/theme-functions/
6+
*
7+
* @package cjt
8+
*/
9+
10+
if (! defined('_S_VERSION')) {
11+
// Replace the version number of the theme on each release.
12+
define('_S_VERSION', '1.0.0');
13+
}
14+
15+
/**
16+
* Sets up theme defaults and registers support for various WordPress features.
17+
*
18+
* Note that this function is hooked into the after_setup_theme hook, which
19+
* runs before the init hook. The init hook is too late for some features, such
20+
* as indicating support for post thumbnails.
21+
*/
22+
function cjt_setup()
23+
{
24+
/*
25+
* Make theme available for translation.
26+
* Translations can be filed in the /languages/ directory.
27+
* If you're building a theme based on cjt, use a find and replace
28+
* to change 'cjt' to the name of your theme in all the template files.
29+
*/
30+
load_theme_textdomain('cjt', get_template_directory() . '/languages');
31+
32+
// Add default posts and comments RSS feed links to head.
33+
add_theme_support('automatic-feed-links');
34+
35+
/*
36+
* Let WordPress manage the document title.
37+
* By adding theme support, we declare that this theme does not use a
38+
* hard-coded <title> tag in the document head, and expect WordPress to
39+
* provide it for us.
40+
*/
41+
add_theme_support('title-tag');
42+
43+
/*
44+
* Enable support for Post Thumbnails on posts and pages.
45+
*
46+
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
47+
*/
48+
add_theme_support('post-thumbnails');
49+
50+
// This theme uses wp_nav_menu() in one location.
51+
register_nav_menus(
52+
array(
53+
'menu-1' => esc_html__('Primary', 'cjt'),
54+
)
55+
);
56+
57+
/*
58+
* Switch default core markup for search form, comment form, and comments
59+
* to output valid HTML5.
60+
*/
61+
add_theme_support(
62+
'html5',
63+
array(
64+
'search-form',
65+
'comment-form',
66+
'comment-list',
67+
'gallery',
68+
'caption',
69+
'style',
70+
'script',
71+
)
72+
);
73+
74+
// Set up the WordPress core custom background feature.
75+
add_theme_support(
76+
'custom-background',
77+
apply_filters(
78+
'cjt_custom_background_args',
79+
array(
80+
'default-color' => 'ffffff',
81+
'default-image' => '',
82+
)
83+
)
84+
);
85+
86+
// Add theme support for selective refresh for widgets.
87+
add_theme_support('customize-selective-refresh-widgets');
88+
89+
/**
90+
* Add support for core custom logo.
91+
*
92+
* @link https://codex.wordpress.org/Theme_Logo
93+
*/
94+
add_theme_support(
95+
'custom-logo',
96+
array(
97+
'height' => 250,
98+
'width' => 250,
99+
'flex-width' => true,
100+
'flex-height' => true,
101+
)
102+
);
103+
}
104+
add_action('after_setup_theme', 'cjt_setup');
105+
106+
/**
107+
* Set the content width in pixels, based on the theme's design and stylesheet.
108+
*
109+
* Priority 0 to make it available to lower priority callbacks.
110+
*
111+
* @global int $content_width
112+
*/
113+
function cjt_content_width()
114+
{
115+
$GLOBALS['content_width'] = apply_filters('cjt_content_width', 640);
116+
}
117+
add_action('after_setup_theme', 'cjt_content_width', 0);
118+
119+
/**
120+
* Register widget area.
121+
*
122+
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
123+
*/
124+
function cjt_widgets_init()
125+
{
126+
register_sidebar(
127+
array(
128+
'name' => esc_html__('Sidebar', 'cjt'),
129+
'id' => 'sidebar-1',
130+
'description' => esc_html__('Add widgets here.', 'cjt'),
131+
'before_widget' => '<section id="%1$s" class="widget %2$s">',
132+
'after_widget' => '</section>',
133+
'before_title' => '<h2 class="widget-title">',
134+
'after_title' => '</h2>',
135+
)
136+
);
137+
}
138+
add_action('widgets_init', 'cjt_widgets_init');
139+
140+
/**
141+
* Enqueue scripts and styles.
142+
*/
143+
function cjt_scripts()
144+
{
145+
wp_enqueue_style('cjt-style', get_stylesheet_uri(), array(), _S_VERSION);
146+
147+
wp_enqueue_script('cjt-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), _S_VERSION, true);
148+
wp_enqueue_script('cjt-marquee', get_template_directory_uri() . '/assets/js/marquee.js', array(), _S_VERSION, true);
149+
150+
if (is_singular() && comments_open() && get_option('thread_comments')) {
151+
wp_enqueue_script('comment-reply');
152+
}
153+
}
154+
add_action('wp_enqueue_scripts', 'cjt_scripts', 9999);
155+
156+
/**
157+
* Implement the Custom Header feature.
158+
*/
159+
require get_template_directory() . '/inc/custom-header.php';
160+
161+
/**
162+
* Custom template tags for this theme.
163+
*/
164+
require get_template_directory() . '/inc/template-tags.php';
165+
166+
/**
167+
* Functions which enhance the theme by hooking into WordPress.
168+
*/
169+
require get_template_directory() . '/inc/template-functions.php';
170+
171+
/**
172+
* Customizer additions.
173+
*/
174+
require get_template_directory() . '/inc/customizer.php';
175+
176+
/**
177+
* Load Jetpack compatibility file.
178+
*/
179+
if (defined('JETPACK__VERSION')) {
180+
require get_template_directory() . '/inc/jetpack.php';
181+
}
182+
183+
function add_additional_class_on_li($classes, $item, $args)
184+
{
185+
if (isset($args->add_li_class)) {
186+
$classes[] = $args->add_li_class;
187+
}
188+
return $classes;
189+
}
190+
add_filter('nav_menu_css_class', 'add_additional_class_on_li', 1, 3);

0 commit comments

Comments
 (0)