/**
* SecondLine functions and definitions
*
* @package secondline
* @since secondline 1.0
*/
if ( ! function_exists( 'secondline_themes_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which runs
* before the init hook. The init hook is too late for some features, such as indicating
* support post thumbnails.
*
* @since secondline 1.0
*/
function secondline_themes_setup() {
// Post Thumbnails - Default Image Sizes
add_theme_support( 'post-thumbnails' );
add_image_size('secondline-themes-blog-index', 800, 500, true);
add_image_size('secondline-themes-single-post-addon', 400, 250, true);
add_image_size('secondline-themes-blog-post', 1400, 700, true);
/**
* Make theme available for translation
* Translations can be filed in the /languages/ directory
* If you're building a theme based on this one, use a find and replace
* to change 'satchmo-secondline' to the name of your theme in all the template files
*/
load_theme_textdomain( 'satchmo-secondline', get_template_directory() . '/languages' );
/**
* Add default posts and comments RSS feed links to head
*/
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'post-formats', array( 'gallery', 'video', 'audio', 'quote', 'link', 'image' ) );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded
tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/**
* This theme uses wp_nav_menu() in one location.
*/
register_nav_menus( array(
'secondline-themes-primary' => esc_html__( 'Primary Menu', 'satchmo-secondline' ),
'secondline-themes-mobile-menu' => esc_html__( 'Mobile Menu', 'satchmo-secondline' ),
'secondline-themes-footer-menu' => esc_html__( 'Footer Menu', 'satchmo-secondline' ),
) );
}
endif; // secondline_themes_setup
add_action( 'after_setup_theme', 'secondline_themes_setup' );
/* Remove Default SimplePodcastPress & PodLove Player */
global $ob_wp_simplepodcastpress;
remove_filter('the_content', array($ob_wp_simplepodcastpress, 'spp_the_content'));
remove_filter( 'the_content', 'podlove_autoinsert_templates_into_content' );
/* Remove Elementor Splash Welcome Screen */
function satchmo_secondline_remove_elementor_splash() {
delete_transient( 'elementor_activation_redirect' );
}
add_action( 'init', 'satchmo_secondline_remove_elementor_splash' );
/**
* Set the content width based on the theme's design and stylesheet.
*
* @since slt 1.0
*/
if ( ! isset( $content_width ) )
$content_width = esc_attr( get_theme_mod('secondline_themes_site_width', '1200') ); /* pixels */
/**
* Register widgetized area and update sidebar with default widgets
*
* @since slt 1.0
*/
function secondline_themes_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'satchmo-secondline' ),
'description' => esc_html__('Default sidebar', 'satchmo-secondline'),
'id' => 'secondline-themes-sidebar',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Mobile/Tablet Sidebar', 'satchmo-secondline' ),
'description' => esc_html__('Mobile/Tablet sidebar', 'satchmo-secondline'),
'id' => 'secondline-themes-mobile-sidebar',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Widgets', 'satchmo-secondline' ),
'description' => esc_html__( 'Footer Widgets', 'satchmo-secondline' ),
'id' => 'secondline-themes-footer-widgets',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'secondline_themes_widgets_init' );
/**
* Enqueue scripts and styles
*/
function secondline_themes_scripts() {
wp_enqueue_style( 'wp-mediaelement' );
wp_enqueue_script( 'wp-mediaelement' );
wp_enqueue_style( 'secondline-style', get_stylesheet_uri());
wp_enqueue_style( 'secondline-google-fonts', secondline_themes_fonts_url(), array( 'secondline-style' ), '1.0.0' );
wp_enqueue_script( 'secondline-plugins', get_template_directory_uri() . '/js/plugins.js', array( 'jquery' ), '20120206', true );
wp_enqueue_script( 'secondline-scripts', get_template_directory_uri() . '/js/script.js', array( 'jquery' ), '20120206', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }
}
add_action( 'wp_enqueue_scripts', 'secondline_themes_scripts' );
/**
* Enqueue google fonts
*/
function secondline_themes_fonts_url() {
$secondline_themes_font_url = '';
/*
Translators: If there are characters in your language that are not supported
by chosen font(s), translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Google font: on or off', 'satchmo-secondline' ) ) {
$secondline_themes_font_url = add_query_arg( 'family', urlencode( 'Montserrat:300,400,700|Neuton:200,300,400,700|&subset=latin' ), "//fonts.googleapis.com/css" );
}
return $secondline_themes_font_url;
}
/**
* Load theme updater functions.
* Action is used so that child themes can easily disable.
*/
function secondline_themes_theme_updater() {
require( get_template_directory() . '/updater/theme-updater.php' );
}
add_action( 'after_setup_theme', 'secondline_themes_theme_updater' );
/**
* Add support for Gutenberg.
*
* @link https://wordpress.org/gutenberg/handbook/reference/theme-support/
*/
function secondline_themes_supported_features() {
add_theme_support( 'editor-color-palette', array(
array(
'name' => esc_html__( 'White', 'satchmo-secondline' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Black', 'satchmo-secondline' ),
'slug' => 'black',
'color' => '#000000',
),
array(
'name' => esc_html__( 'Dark Gray', 'satchmo-secondline' ),
'slug' => 'dark-gray',
'color' => '#2d2d2d',
),
array(
'name' => esc_html__( 'Satchmo Red', 'satchmo-secondline' ),
'slug' => 'satchmo-red',
'color' => '#c01f2c',
),
array(
'name' => esc_html__( 'Gray', 'satchmo-secondline' ),
'slug' => 'gray',
'color' => '#555555',
),
array(
'name' => esc_html__( 'Light Gray', 'satchmo-secondline' ),
'slug' => 'light-gray',
'color' => '#e8e8e8',
),
array(
'name' => esc_html__( 'Main Button Background', 'satchmo-secondline' ),
'slug' => 'button-background',
'color' => get_theme_mod('secondline_themes_button_background', '#2d2d2d', true),
),
array(
'name' => esc_html__( 'Main Button Background Hover', 'satchmo-secondline' ),
'slug' => 'button-background-hover',
'color' => get_theme_mod('secondline_themes_button_background_hover', '#4c4b46', true),
),
));
add_theme_support( 'align-wide' );
}
add_action( 'after_setup_theme', 'secondline_themes_supported_features' );
/**
* Enqueue editor styles for Gutenberg
*/
function theme_slug_editor_styles() {
wp_enqueue_style( 'secondline-themes-editor-style', get_template_directory_uri() . '/css/slt-editor-style.css' );
wp_enqueue_style( 'secondline-google-fonts-editor', secondline_themes_fonts_url(), array( 'secondline-themes-editor-style' ), '1.0.0' );
}
add_action( 'enqueue_block_editor_assets', 'theme_slug_editor_styles' );
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom Metabox Fields
*/
require get_template_directory() . '/inc/custom-meta.php';
/**
* Theme Customizer
*/
require get_template_directory() . '/inc/default-customizer.php';
/**
* JS Customizer Out
*/
require get_template_directory() . '/inc/js-customizer.php';
/**
* Elementor Page Builder Functions
*/
require get_template_directory() . '/inc/elementor-functions.php';
/**
* Audio Specific Functions
*/
require get_template_directory() . '/inc/audio-functions.php';
/**
* Load Plugin TGMPA
*/
require get_template_directory() . '/inc/tgm-plugin-activation/plugin-activation.php';
/**
* Load MerlinWP
*/
require_once get_parent_theme_file_path( '/inc/merlin/vendor/autoload.php' );
require_once get_parent_theme_file_path( '/inc/merlin/class-merlin.php' );
require_once get_parent_theme_file_path( '/inc/merlin/merlin-config.php' );
add_action('wp_head', function(){echo '';}, 1);