-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
46 lines (35 loc) · 1.65 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
<?php
function onepage_enqueue_styles() {
// Parent theme style
$parent_style = 'twentyseventeen-style-2';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
// Bootstrap Scrollspy
wp_enqueue_script( 'bootstrap-scrollspy', get_stylesheet_directory_uri() . '/bootstrap-scrollspy.min.js', array('jquery') );
// Location update for Scrollspy
wp_enqueue_script( 'bootstrap-scrollspy-location', get_stylesheet_directory_uri() . '/bootstrap-scrollspy-location.min.js', array('bootstrap-scrollspy') );
}
add_action( 'wp_enqueue_scripts', 'onepage_enqueue_styles', 100 );
// override for inc/customizer.php
function twentyseventeen_customize_register_sluganchors( $wp_customize ) {
$num_sections = apply_filters( 'twentyseventeen_front_page_sections', 4 );
for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) {
$panel_partial = $wp_customize->selective_refresh->get_partial( 'panel_' . $i);
$panel_partial->render_callback = 'twentyseventeen_front_page_section_sluganchors';
}
}
add_action( 'customize_register', 'twentyseventeen_customize_register_sluganchors' );
/*
* A simple function to control the number of Twenty Seventeen Theme Front Page Sections
* Source: wpcolt.com
*/
/* Uncomment + adjust the amount in case you need it:
function twentyseventeen_custom_front_sections( $num_sections ) {
return 7; // Change this number to change the number of the sections.
}
add_filter( 'twentyseventeen_front_page_sections', 'twentyseventeen_custom_front_sections' );
*/