/**
* Rhythm functions and definitions
*
* @package Rhythm
*/
/**
* Theme options variable $ts_theme_options
*/
define ('REDUX_OPT_NAME', 'ts_theme_options');
/**
* Setting constant to inform the plugin that them is activated
*/
define ('RHYTHM_THEME_ACTIVATED' , true);
/**
* Theme version used for styles,js
*/
define ('TS_THEME_VERSION','103');
/**
* Helper functions
*/
require get_template_directory() . '/inc/helpers.php';
/**
* Template parts functions
*/
require get_template_directory() . '/inc/template-parts.php';
/**
* Theme extensions
*/
require get_template_directory() . '/extensions/admin.php';
/**
* Add Redux Framework & extras
*/
require get_template_directory() . '/admin/admin-init.php';
/**
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) ) {
$content_width = 640; /* pixels */
}
if ( ! function_exists( 'rhythm_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 for post thumbnails.
*/
function rhythm_setup() {
define ('TINY_EXCERPT', 10);
define ('SHORT_EXCERPT', 20);
define ('REGULAR_EXCERPT', 40);
define ('LONG_EXCERPT', 60);
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Rhythm, use a find and replace
* to change 'rhythm' to the name of your theme in all the template files
*/
load_theme_textdomain( 'rhythm', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/**
* Custom image sizes
*/
add_theme_support( 'post-thumbnails' );
if (function_exists('rhythm_add_image_sizes')) {
rhythm_add_image_sizes();
}
/*
* 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' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
//add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'rhythm' ),
'preheader-left' => __( 'Preheader left', 'rhythm' ),
'preheader-right' => __( 'Preheader right', 'rhythm' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption',
) );
/*
* Enable support for Post Formats.
* See http://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside', 'image', 'video', 'gallery', 'quote', 'link',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'rhythm_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
//woocommerce support
add_theme_support( 'woocommerce' );
}
endif; // rhythm_setup
add_action( 'after_setup_theme', 'rhythm_setup' );
if (!function_exists('rhythm_add_image_sizes')) {
/**
* Add image sizes
*/
function rhythm_add_image_sizes() {
add_image_size('ts-tiny', 70, 70, true);
add_image_size('ts-thumb', 458, 247, true);
add_image_size('ts-thumb-no-crop', 458, 247);
add_image_size('ts-medium', 570, 367, true);
add_image_size('ts-big', 720, 463, true);
add_image_size('ts-full-alt', 650, 418, true);
add_image_size('ts-vertical-alt', 650, 836, true);
add_image_size('ts-full', 1140, 642, true);
add_image_size('ts-vertical', 360, 438, true);
add_image_size('ts-horizontal-thumb', 90, 60, true);
add_image_size('ts-magazine', 617, 347, true);
}
}
/**
* Register widget area.
*
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function rhythm_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Sidebar', 'rhythm' ),
'id' => 'main',
'description' => '',
'before_widget' => '