-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
63 lines (49 loc) · 1.74 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* WordPress theme functions
*
* This is where you add unique features to your WordPress theme. It can be used
* to hook into the core functions of WordPress to make your theme more modular,
* extensible, and functional. Functions and methods are extracted under /inc
* to class files and helpers for better code readability
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Astro
*/
use Astro\Inc\Theme;
if ( ! defined('DIR_PATH')) {
define('DIR_PATH', untrailingslashit(get_template_directory()));
}
if ( ! defined('DIR_URI')) {
define('DIR_URI', untrailingslashit(get_template_directory_uri()));
}
if ( ! defined('BUILD_CSS_PATH')) {
define('BUILD_CSS_PATH', untrailingslashit(get_template_directory()) . '/assets/build/css');
}
if ( ! defined('BUILD_CSS_URI')) {
define('BUILD_CSS_URI', untrailingslashit(get_template_directory_uri()) . '/assets/build/css');
}
if ( ! defined('BUILD_JS_PATH')) {
define('BUILD_JS_PATH', untrailingslashit(get_template_directory()) . '/assets/build/js');
}
if ( ! defined('BUILD_JS_URI')) {
define('BUILD_JS_URI', untrailingslashit(get_template_directory_uri()) . '/assets/build/js');
}
if ( ! defined('IMG_URI')) {
define('IMG_URI', untrailingslashit(get_template_directory_uri()) . '/assets/src/img');
}
require_once DIR_PATH . '/inc/helpers/autoloader.php';
require_once DIR_PATH . '/inc/helpers/template-tags.php';
function astro_get_theme_instance()
{
Theme::get_instance();
}
astro_get_theme_instance();
add_filter('relevanssi_modify_wp_query', 'rlv_oldest_first');
function rlv_oldest_first($query)
{
$query->set('orderby', ['relevance' => 'dsc']);
return $query;
}
add_filter('img_caption_shortcode_width', '__return_false');