59 lines
1.4 KiB
PHP
59 lines
1.4 KiB
PHP
<?php
|
|
add_theme_support( 'automatic-feed-links' );
|
|
add_theme_support( 'menus' );
|
|
add_theme_support( 'post-thumbnails' );
|
|
|
|
// Register Custom Navigation Walker
|
|
require_once('wp-bootstrap-navwalker.php');
|
|
|
|
if ( function_exists('register_sidebar') ) {
|
|
register_sidebar(array(
|
|
'before_widget' => '<div class="the-sidebar">',
|
|
'after_widget' => '</div>',
|
|
'before_title' => '<h4 class="widgettitle">',
|
|
'after_title' => '</h4>',
|
|
));
|
|
}
|
|
|
|
|
|
/* ACF */
|
|
if( function_exists('acf_add_options_page') ) {
|
|
|
|
acf_add_options_page(array(
|
|
'page_title' => 'General Options',
|
|
'menu_title' => 'General Options',
|
|
'menu_slug' => 'theme-general-options',
|
|
'capability' => 'edit_posts',
|
|
'redirect' => false
|
|
));
|
|
|
|
}
|
|
|
|
/* Modify the read more link on the_excerpt() */
|
|
|
|
function my_excerpt_length($length) {
|
|
return 120;
|
|
}
|
|
add_filter('excerpt_length', 'my_excerpt_length');
|
|
|
|
function excerpt_readmore($more) {
|
|
return '... <a href="'. get_permalink($post->ID) . '" class="readmore">' . 'Continue Reading »' . '</a>';
|
|
}
|
|
|
|
add_filter('excerpt_more', 'excerpt_readmore');
|
|
|
|
|
|
|
|
function template_chooser($template)
|
|
{
|
|
global $wp_query;
|
|
$post_type = get_query_var('post_type');
|
|
if( $wp_query->is_search && $post_type == 'faq' )
|
|
{
|
|
return locate_template('search-faq.php'); // redirect to archive-search.php
|
|
}
|
|
return $template;
|
|
}
|
|
add_filter('template_include', 'template_chooser');
|
|
|
|
?>
|