File: /mnt/data/doccure-wp-market/wp-content/themes/doccure/inc/functions-setup.php
<?php
/**
* doccure Theme setup functions
*
* @package doccure
*/
if (!defined('ABSPATH')) {
exit;
}
/**
* Get the available image sizes for the theme.
*
* @since 1.0.0
*/
// function doccure_load_textdomain() {
// load_theme_textdomain('doccure', get_template_directory() . '/languages');
// }
// add_action('after_setup_theme', 'doccure_load_textdomain');
function doccure_theme_image_sizes()
{
$image_sizes = array(
'doccure-portfolio' => array(
'width' => 540,
'height' => 380,
'title' => esc_html__('Portfolio Image', 'doccure'),
'crop' => true
),
'doccure-portfolio-square' => array(
'width' => 420,
'height' => 420,
'title' => esc_html__('Portfolio Square Image', 'doccure'),
'crop' => true
),
'doccure-service' => array(
'width' => 600,
'height' => 480,
'title' => esc_html__('Service Image', 'doccure'),
'crop' => true
),
'doccure-small-square' => array(
'width' => 250,
'height' => 250,
'title' => esc_html__('Doccure Square Small Image', 'doccure'),
'crop' => true
),
'doccure-blog-medium' => array(
'width' => 600,
'height' => 645,
'title' => esc_html__('Doccure Blog Medium Image', 'doccure'),
'crop' => true
),
);
return apply_filters('doccure/image_sizes', $image_sizes);
}
/**
* Adjust the names of the theme thumb sizes using the 'image_size_names_choose' filter.
*
* @since 1.0.0
*/
function doccure_theme_thumb_size_names($sizes)
{
$image_sizes = doccure_theme_image_sizes();
$retina_mult = doccure_get_retina_multiplier();
foreach ($image_sizes as $key => $val) {
$sizes[$key] = $val['title'];
if ($retina_mult > 1) {
$sizes[$key . '-@retina'] = $val['title'] . ' ' . esc_html__('@2x', 'doccure');
}
}
return $sizes;
}
function doccure_setup() {
$GLOBALS['content_width'] = apply_filters('doccure_content_width', 640);
// Other theme support stuff...
add_theme_support('automatic-feed-links');
add_theme_support('title-tag');
add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
add_theme_support('custom-background', array());
add_theme_support('customize-selective-refresh-widgets');
add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery', 'audio'));
add_theme_support('custom-logo', array(
'width' => 250,
'height' => 80,
'flex-width' => true,
'flex-height' => true,
));
add_theme_support('woocommerce');
add_theme_support('wc-product-gallery-zoom');
add_theme_support('wc-product-gallery-lightbox');
add_theme_support('wc-product-gallery-slider');
add_theme_support('align-wide');
add_theme_support('responsive-embeds');
add_theme_support('post-thumbnails');
register_nav_menus(array(
'primary-menu' => esc_html__('Primary Menu', 'doccure'),
'mobile-menu' => esc_html__('Mobile Menu', 'doccure'),
'header-privacy-menu' => esc_html__('Footer Privacy Menu', 'doccure'),
));
$image_sizes = doccure_theme_image_sizes();
$retina_mult = doccure_get_retina_multiplier();
foreach ($image_sizes as $key => $val) {
add_image_size($key, $val['width'], $val['height'], $val['crop']);
if ($retina_mult > 1) {
add_image_size($key . '-@retina', $val['width'] * $retina_mult, $val['height'] * $retina_mult, $val['crop']);
}
}
add_filter('image_size_names_choose', 'doccure_theme_thumb_size_names');
}
add_action('after_setup_theme', 'doccure_setup');
// Load translation at the init action