This repository has been archived by the owner on Jun 11, 2022. It is now read-only.
forked from man4toman/Less-Reloaded
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
75 lines (63 loc) · 2.87 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
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/*-----------------------------------------------------------------------------------*/
/* Load Theme textdomain
/*-----------------------------------------------------------------------------------*/
add_action( 'after_setup_theme', 'less_theme_setup' );
function less_theme_setup(){
load_theme_textdomain( 'less-revival', get_template_directory() . '/languages' );
}
// Define the version as a constant so we can easily replace it throughout the theme
define( 'LESS_VERSION', 2.0 );
add_theme_support( 'title-tag' );
/*-----------------------------------------------------------------------------------*/
/* Add Rss to Head
/*-----------------------------------------------------------------------------------*/
add_theme_support( 'automatic-feed-links' );
/*-----------------------------------------------------------------------------------*/
/* Enables custom logo in header
/*-----------------------------------------------------------------------------------*/
$custom_logo_params = array(
'height' => 100,
'width' => 100,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
'unlink-homepage-logo' => true,
);
add_theme_support( 'custom-logo' , $custom_logo_params);
/*-----------------------------------------------------------------------------------*/
/* Add Content width
/*-----------------------------------------------------------------------------------*/
if ( ! isset( $content_width ) ) {
$content_width = 900;
}
/*-----------------------------------------------------------------------------------*/
/* register main menu
/*-----------------------------------------------------------------------------------*/
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'less-revival' ),
)
);
/*-----------------------------------------------------------------------------------*/
/* Enque Styles and Scripts
/*-----------------------------------------------------------------------------------*/
function less_scripts() {
// theme styles
wp_register_style('less-Roboto', 'https://fonts.googleapis.com/css2?family=Roboto&display=swap', array(), null, 'all');
wp_enqueue_style('less-Roboto');
wp_enqueue_style( 'less-style', get_template_directory_uri() . '/style.css', '10000', 'all' );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'less_scripts' );
/*-----------------------------------------------------------------------------------*/
/* Add a pingback url to header
/*-----------------------------------------------------------------------------------*/
function less_pingback_header() {
if ( is_singular() && pings_open() ) {
printf( '<link rel="pingback" href="%s">', esc_url( get_bloginfo( 'pingback_url' ) ) );
}
}
add_action( 'wp_head', 'less_pingback_header' );