File: /home/storage/162/3480162/user/htdocs/wp-content/plugins/envo-magazine-pro/options/global.php
<?php
if ( !class_exists( 'Kirki' ) ) {
return;
}
Kirki::add_section( 'global_section', array(
'title' => esc_attr__( 'Global Options', 'envo-magazine-pro' ),
'priority' => 10,
) );
Kirki::add_field( 'envo_magazine_pro', array(
'type' => 'radio-buttonset',
'settings' => 'content-width',
'label' => __( 'Content width', 'envo-magazine-pro' ),
'section' => 'global_section',
'default' => '1170',
'priority' => 10,
'choices' => array(
'980' => esc_attr__( '980', 'envo-magazine-pro' ),
'1024' => esc_attr__( '1024', 'envo-magazine-pro' ),
'1170' => esc_attr__( '1170', 'envo-magazine-pro' ),
'1280' => esc_attr__( '1280', 'envo-magazine-pro' ),
'1440' => esc_attr__( '1440', 'envo-magazine-pro' ),
),
'output' => array(
array(
'choice' => '1440',
'element' => '.envo-mag-content-1440 .container',
'property' => 'width',
'media_query' => '@media (min-width: 1480px)',
'units' => 'px',
),
array(
'choice' => '1280',
'element' => '.envo-mag-content-1280 .container',
'property' => 'width',
'media_query' => '@media (min-width: 1320px)',
'units' => 'px',
),
array(
'choice' => '1170',
'element' => '.envo-mag-content-1170 .container',
'property' => 'width',
'media_query' => '@media (min-width: 1200px)',
'units' => 'px',
),
array(
'choice' => '1024',
'element' => '.envo-mag-content-1024 .container',
'property' => 'width',
'media_query' => '@media (min-width: 1200px)',
'units' => 'px',
),
array(
'choice' => '980',
'element' => '.envo-mag-content-980 .container',
'property' => 'width',
'media_query' => '@media (min-width: 1200px)',
'units' => 'px',
),
),
) );
Kirki::add_field( 'envo_magazine_pro', array(
'type' => 'radio-buttonset',
'settings' => 'widgets-width',
'label' => __( 'Footer widgets columns', 'envo-magazine-pro' ),
'section' => 'global_section',
'default' => '25',
'priority' => 10,
'transport' => 'auto',
'choices' => array(
'100' => '1',
'50' => '2',
'33.33333333' => '3',
'25' => '4',
),
'output' => array(
array(
'element' => '.widget.col-md-3',
'property' => 'width',
'media_query' => '@media (min-width: 992px)',
'units' => '%',
),
),
) );
Kirki::add_field( 'envo_magazine_pro', array(
'type' => 'image',
'settings' => 'default-image-url',
'label' => esc_attr__( 'Default image', 'envo-magazine-pro' ),
'description' => esc_attr__( 'Appears if no featured image is set for post. Leave blank to disable this function.', 'envo-magazine-pro' ),
'section' => 'global_section',
'default' => '',
'choices' => array(
'save_as' => 'id',
),
) );
Kirki::add_field( 'envo_magazine_pro', array(
'type' => 'toggle',
'settings' => 'lazy-load-on',
'label' => esc_attr__( 'Lazy Load Images', 'envo-magazine-pro' ),
'section' => 'global_section',
'default' => '1',
'priority' => 10,
) );
Kirki::add_field( 'envo_magazine_pro', array(
'type' => 'toggle',
'settings' => 'featured-gallery-on',
'label' => esc_attr__( 'Featured image gallery', 'envo-magazine-pro' ),
'section' => 'global_section',
'default' => '1',
'priority' => 10,
) );
Kirki::add_field( 'envo_magazine_pro', array(
'type' => 'radio-buttonset',
'settings' => 'date-on',
'label' => esc_attr__( 'Post date', 'envo-magazine-pro' ),
'section' => 'global_section',
'default' => 'inline',
'priority' => 10,
'choices' => array(
'inline' => esc_attr__( 'Visible', 'textdomain' ),
'none' => esc_attr__( 'Hidden', 'textdomain' ),
),
'output' => array(
array(
'element' => '.posted-date',
'property' => 'display',
),
),
) );
Kirki::add_field( 'envo_magazine_pro', array(
'type' => 'radio-buttonset',
'settings' => 'comments-on',
'label' => esc_attr__( 'Comments count', 'envo-magazine-pro' ),
'section' => 'global_section',
'default' => 'inline',
'priority' => 10,
'choices' => array(
'inline-block' => esc_attr__( 'Visible', 'textdomain' ),
'none' => esc_attr__( 'Hidden', 'textdomain' ),
),
'output' => array(
array(
'element' => '.comments-meta',
'property' => 'display',
),
),
) );
Kirki::add_field( 'envo_magazine_pro', array(
'type' => 'radio-buttonset',
'settings' => 'author-on',
'label' => esc_attr__( 'Post author', 'envo-magazine-pro' ),
'section' => 'global_section',
'default' => 'inline-block',
'priority' => 10,
'choices' => array(
'inline-block' => esc_attr__( 'Visible', 'textdomain' ),
'none' => esc_attr__( 'Hidden', 'textdomain' ),
),
'output' => array(
array(
'element' => '.author-meta',
'property' => 'display',
),
),
) );
add_filter( 'body_class', 'envo_magazine_pro_body_class_width' );
function envo_magazine_pro_body_class_width( $classes ) {
$content = get_theme_mod( 'content-width', '1170' );
$no_date = get_theme_mod( 'date-on', 'inline' );
$classes[] = 'envo-mag-content-' . $content;
$classes[] = 'envo-mag-date-' . $no_date;
return $classes;
}