/
functions.php
40 lines (30 loc) · 954 Bytes
/
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
<?php
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
add_theme_support( 'post-thumbnails' );
add_action( 'after_setup_theme', 'wpt_setup' );
if ( ! function_exists( 'wpt_setup' ) ):
function wpt_setup() {
register_nav_menu( 'primary', __( 'Primary navigation', 'wptuts' ) );
} endif;
require_once('wp_bootstrap_navwalker.php');
if (class_exists('MultiPostThumbnails')) {
new MultiPostThumbnails(
array(
'label' => 'Page Header',
'id' => 'page-header',
'post_type' => 'post'
)
);
}
function get_custom_cat_template($single_template) {
global $post;
if ( in_category( 'adventure' )) {
$single_template = dirname( __FILE__ ) . '/single-adventure.php';
}
return $single_template;
}
add_filter( "single_template", "get_custom_cat_template" ) ;
?>