This repository has been archived by the owner on Oct 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
84 lines (78 loc) · 2.88 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
76
77
78
79
80
81
82
83
84
<?php
function startwordpress_scripts() {
wp_enqueue_style ( 'bootstrap', get_template_directory_uri () . '/data/css/bootstrap.min.css', array (), '3.3.6' );
wp_enqueue_style ( 'normalize', get_template_directory_uri () . '/data/css/normalize.css' );
wp_enqueue_style ( 'luxvacuos', get_template_directory_uri () . '/data/css/luxvacuos.css' );
wp_enqueue_script ( 'bootstrap', get_template_directory_uri () . '/data/js/bootstrap.min.js', array (
'jquery'
), '3.3.6', true );
wp_enqueue_script ( 'luxvacuos', get_template_directory_uri () . '/data/js/luxvacuos.js' );
}
add_action ( 'wp_enqueue_scripts', 'startwordpress_scripts' );
function startwordpress_google_fonts() {
wp_register_style ( 'Muli', 'https://fonts.googleapis.com/css?family=Muli' );
wp_enqueue_style ( 'Muli' );
wp_register_style ( 'Poppins', 'https://fonts.googleapis.com/css?family=Poppins' );
wp_enqueue_style ( 'Poppins' );
}
add_action ( 'wp_print_styles', 'startwordpress_google_fonts' );
add_theme_support ( 'title-tag' );
function custom_settings_add_menu() {
add_menu_page ( 'Lux Vacuos Settings', 'Lux Vacuos Settings', 'manage_options', 'custom-settings', 'custom_settings_page', null, 99 );
}
add_action ( 'admin_menu', 'custom_settings_add_menu' );
function custom_settings_page() {
?>
<div class="wrap">
<h1>Lux Vacuos Settings</h1>
<form method="post" action="options.php">
<?php
settings_fields ( 'section' );
do_settings_sections ( 'theme-options' );
submit_button ();
?>
</form>
</div>
<?php
}
function setting_youtube() {
?>
<input type="text" name="youtube" id="youtube"
value="<?php echo get_option('youtube'); ?>" />
<?php
}
function setting_twitter() {
?>
<input type="text" name="twitter" id="twitter"
value="<?php echo get_option('twitter'); ?>" />
<?php
}
function setting_reddit() {
?>
<input type="text" name="reddit" id="reddit"
value="<?php echo get_option('reddit'); ?>" />
<?php
}
function setting_github() {
?>
<input type="text" name="github" id="github"
value="<?php echo get_option('github'); ?>" />
<?php
}
function custom_settings_page_setup() {
add_settings_section ( 'section', 'All Settings', null, 'theme-options' );
add_settings_field ( 'youtube', 'Youtube URL', 'setting_youtube', 'theme-options', 'section' );
add_settings_field ( 'twitter', 'Twitter URL', 'setting_twitter', 'theme-options', 'section' );
add_settings_field ( 'reddit', 'Reddit URL', 'setting_reddit', 'theme-options', 'section' );
add_settings_field ( 'github', 'GitHub URL', 'setting_github', 'theme-options', 'section' );
register_setting ( 'section', 'youtube' );
register_setting ( 'section', 'twitter' );
register_setting ( 'section', 'reddit' );
register_setting ( 'section', 'github' );
}
add_action ( 'admin_init', 'custom_settings_page_setup' );
add_theme_support ( 'post-thumbnails' );
function new_excerpt_length($length) {
return 200;
}
add_filter ( 'excerpt_length', 'new_excerpt_length' );