// Theme Scripts & Styles
function theme_scripts() {
wp_enqueue_style( 'main', get_stylesheet_uri(), array(), filemtime( get_template_directory() . '/style.css') );
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Open+Sans:300italic,700italic,400,300,700' );
wp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/scripts.min.js', array('jquery'), filemtime( get_template_directory() . '/js/scripts.min.js'), true );
}
add_action( 'wp_enqueue_scripts', 'theme_scripts' );
// Theme Options
if( function_exists('acf_add_options_page') ) {
acf_add_options_page();
}
// Add title tag to
section
add_theme_support( 'title-tag' );
if ( ! function_exists( '_wp_render_title_tag' ) ) :
function theme_slug_render_title() {
return '' . wp_title( '|', true, 'right' ) . '';
}
add_action( 'wp_head', 'theme_slug_render_title' );
endif;
// Add RSS links to section
add_theme_support( 'automatic-feed-links' );
// Clean up the
function removeHeadLinks() {
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
}
add_action('init', 'removeHeadLinks');
remove_action('wp_head', 'wp_generator');
// Add Read More link to excerpt
function new_excerpt_more($more) {
global $post;
return '…';
}
add_filter('excerpt_more', 'new_excerpt_more');
// Add Featured Image support
add_theme_support( 'post-thumbnails' );
// Set Featured Image
function feat_image() {
if ( has_post_thumbnail() ) {
// Get the post thumbnail URL
$feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
} else {
// Get the default featured image in theme options
$feat_image = get_field('default_featured_image', 'option');
}
echo $feat_image;
}
?>