Files
Testing/blog/wp-content/themes/bateworld/functions.php
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

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 &raquo;' . '</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');
?>