'. __( 'Here you can set the theme appearance site-wide. The appearance settings here can be override on individual post/page > edit > Themify Custom Panel > Page Appearance).', 'themify' ) .'';
/**
* Theme Color
* @var array
*/
$design_options = themify_theme_color_design_options();
/**
* Prefix for theme settings
* @var string
*/
$pre = 'setting-color_design';
/**
* Theme Color
*/
$html .= '
' . __( 'Theme Color', 'themify' ) . ' ';
$val = themify_get( $pre,'',true );
foreach ( $design_options as $option ) {
if ( ( '' == $val || ! $val ) && $option['selected'] ) {
$val = $option['value'];
}
$class = ( $val == $option['value'] ) ? 'selected' : '';
$html .= ' ';
}
$html .= '
';
/**
* Typography
* @var array
*/
$design_options = themify_theme_font_design_options();
/**
* Prefix for theme settings
* @var string
*/
$pre = 'setting-font_design';
/**
* Typography
*/
$html .= '
' . __( 'Typography', 'themify' ) . ' ';
$val = themify_get( $pre,'',true);
foreach ( $design_options as $option ) {
if ( ( '' == $val || ! $val ) && $option['selected'] ) {
$val = $option['value'];
}
$class = ( $val == $option['value'] ) ? 'selected' : '';
$html .= ' ';
}
$html .= '
';
/**
* Header Design
* @var array
*/
$design_options = themify_theme_header_design_options();
/**
* Prefix for theme settings
* @var string
*/
$pre = 'setting-header_design';
// Store items to hide
$html .= '';
/**
* Header Design
*/
$html .= '
' . __( 'Header Design', 'themify' ) . ' ';
$val = themify_get( $pre,'header-horizontal',true);
$html .= '';
unset( $design_options[0] );
foreach ( $design_options as $option ) {
$class = ( $val == $option['value'] ) ? 'selected' : '';
$html .= ' ';
}
$html .= ' ';
$html .= ' ';
'
';
/**
* Fixed header
*/
$html .= sprintf('',
'setting-revealing_header',
checked( themify_get( 'setting-revealing_header' ), 'on', false ),
__('Enable Revealing Header', 'themify')
);
$html .= sprintf('',
'setting-fixed_header_disabled',
checked( themify_get( 'setting-fixed_header_disabled' ), 'on', false ),
__('Disable Sticky Header', 'themify')
);
/**
* Full height header
*/
$key = 'setting-full_height_header';
$html .= sprintf('',
$key,
checked( themify_get( $key ), 'yes', false ),
__( 'Full Height Header', 'themify' ),
__( 'Full height will display the container in 100% viewport height', 'themify' )
);
/**
* Exclude Site Logo
*/
$html .= sprintf('
%3$s
',
'setting-exclude_site_logo',
checked( themify_get( 'setting-exclude_site_logo' ), 'on', false ),
__('Exclude Site Logo', 'themify')
);
/**
* Exclude Site Tagline
*/
$html .= sprintf('
%3$s
',
'setting-exclude_site_tagline',
checked( themify_get( 'setting-exclude_site_tagline' ), 'on', false ),
__('Exclude Site Tagline', 'themify')
);
/**
* Exclude Search Form
*/
$html .= sprintf('
%3$s
',
'setting-exclude_search_form',
checked( themify_get( 'setting-exclude_search_form' ), 'on', false ),
__('Exclude Search Form', 'themify')
);
/**
* search form options
*/
$search_type=themify_get('setting_search_form','live_search',true );
$html .= '
';
// live search
$html .= '';
$html .= ' ';
$html .= __( 'Live Search', 'themify' ) . ' ';
// search form
$html .= '';
$html .= ' ';
$html .= __( 'Inline Search Form', 'themify' ) . '
';
// search form
$html .= '
';
$html .= ' ';
$html .= __( 'Enable Ajax Search', 'themify' ) . '
';
$html .= '';
/**
* Exclude Header Widgets
*/
$html .= sprintf('
%3$s
',
'setting-exclude_header_widgets',
checked( themify_get( 'setting-exclude_header_widgets' ), 'on', false ),
__('Exclude Header Widgets', 'themify')
);
/**
* Exclude Social Widgets
*/
$html .= sprintf('
%3$s
',
'setting-exclude_social_widget',
checked( themify_get( 'setting-exclude_social_widget' ), 'on', false ),
__('Exclude Social Widgets', 'themify')
);
/**
* Exclude Menu Navigation
*/
$html .= sprintf('
%3$s
',
'setting-exclude_menu_navigation',
checked( themify_get( 'setting-exclude_menu_navigation' ), 'on', false ),
__('Exclude Menu Navigation', 'themify')
);
if( themify_is_woocommerce_active() ) {
/**
* Exclude Cart Icon
*/
$html .= sprintf('
%3$s
',
'setting-exclude_cart_icon',
checked( themify_get( 'setting-exclude_cart_icon' ), 'on', false ),
__('Exclude Cart Icon', 'themify')
);
/**
* Disable Slide Cart
*/
$html .= '
';
$html .= ''.__('Disable slide cart on:','themify');
$html.=' ' . themify_options_module( array(
array( 'name' => '', 'value' => '' ),
array( 'name' => __( 'All devices', 'themify' ), 'value' => 'all' ),
array( 'name' => __( 'Tablet/mobile', 'themify' ), 'value' => 'mobile' ),
), 'setting-disable-slide-cart' ) . '
';
$html .= '
';
}
/**
* Mobile Menu Design
*/
$html .= '
' . __( 'Mobile Menu Style', 'themify' ) . ' ';
$html.='' . themify_options_module( array(
array( 'name' => __( 'Default', 'themify' ), 'value' => 'default' ),
array( 'name' => __( 'Boxed', 'themify' ), 'value' => 'boxed' ),
array( 'name' => __( 'Dropdown', 'themify' ), 'value' => 'dropdown' ),
array( 'name' => __( 'Fade Overlay', 'themify' ), 'value' => 'fade-overlay' ),
array( 'name' => __( 'Fadein Down', 'themify' ), 'value' => 'fadein-down' ),
array( 'name' => __( 'Flip Down', 'themify' ), 'value' => 'flip-down' ),
array( 'name' => __( 'FlipIn Left', 'themify' ), 'value' => 'flipin-left' ),
array( 'name' => __( 'FlipIn Right', 'themify' ), 'value' => 'flipin-right' ),
array( 'name' => __( 'Flip from Left', 'themify' ), 'value' => 'flip-from-left' ),
array( 'name' => __( 'Flip from Right', 'themify' ), 'value' => 'flip-from-right' ),
array( 'name' => __( 'Flip from Top', 'themify' ), 'value' => 'flip-from-top' ),
array( 'name' => __( 'Flip from Bottom', 'themify' ), 'value' => 'flip-from-bottom' ),
array( 'name' => __( 'Morphing', 'themify' ), 'value' => 'morphing' ),
array( 'name' => __( 'Overlay ZoomIn', 'themify' ), 'value' => 'overlay-zoomin' ),
array( 'name' => __( 'Overlay ZoomIn Right', 'themify' ), 'value' => 'overlay-zoomin-right' ),
array( 'name' => __( 'Rotate ZoomIn', 'themify' ), 'value' => 'rotate-zoomin' ),
array( 'name' => __( 'Slide Down', 'themify' ), 'value' => 'slide-down' ),
array( 'name' => __( 'SlideIn Left', 'themify' ), 'value' => 'slidein-left' ),
array( 'name' => __( 'SlideIn Right', 'themify' ), 'value' => 'slidein-right' ),
array( 'name' => __( 'Slide Left Content', 'themify' ), 'value' => 'slide-left-content' ),
array( 'name' => __( 'Split', 'themify' ), 'value' => 'split' ),
array( 'name' => __( 'Swing Left to Right', 'themify' ), 'value' => 'swing-left-to-right' ),
array( 'name' => __( 'Swing Right to Left', 'themify' ), 'value' => 'swing-right-to-left' ),
array( 'name' => __( 'Swing Top to Bottom', 'themify' ), 'value' => 'swing-top-to-bottom' ),
array( 'name' => __( 'Swipe Left', 'themify' ), 'value' => 'swipe-left' ),
array( 'name' => __( 'Swipe Right', 'themify' ), 'value' => 'swipe-right' ),
array( 'name' => __( 'Zoom Down', 'themify' ), 'value' => 'zoomdown' ),
), 'setting-mobile-menu-styles' ) . '
';
/**
* Expand All child menus
*/
$html .= sprintf('
%3$s
',
'setting-mobile_menu_expand',
checked( themify_get( 'setting-mobile_menu_expand','',true ), 'on', false ),
__('Expand all child menus', 'themify')
);
/**
* Toggle child menus
*/
$html .= sprintf('
%3$s
',
'setting-mobile_menu_toggle',
checked( themify_get( 'setting-mobile_menu_toggle','',true ), 'on', false ),
__('Toggle child menus like accordion', 'themify')
);
// End group of elements to hide
$html .= '
';
$html .= '' . __( 'Main Menu Tooltip', 'themify' ) .themify_help(__( 'On main navigation menu, use WordPress menu link title attribute as tooltip.', 'themify' )) . ' ';
$html .= sprintf(' %3$s
',
'menu_tooltips',
checked( themify_get( 'menu_tooltips','',true ), 'on', false ),
__('Enable menu tooltip (use link title attribute as tooltip)', 'themify')
);
$html .= '';
$html .= '' . __( 'Main Menu Description', 'themify' ) . themify_help( sprintf( __( 'On main navigation menu, display the item description below the title.', 'themify' ), 'https://codex.wordpress.org/WordPress_Menu_User_Guide#Customizing_Menu_Items' ) ) . ' ';
$html .= sprintf(' %3$s
',
'menu_description',
checked( themify_get( 'menu_description','',true ), 'on', false ),
__('Display menu link description text', 'themify')
);
$html .= '';
/**
* Header Widgets
*/
$options = array(
array(
'value' => 'headerwidget-4col',
'img' => 'themify/img/sidebars/4col.png',
'title' => __('Widgets 4 Columns', 'themify')),
array(
'value' => 'headerwidget-3col',
'img' => 'themify/img/sidebars/3col.png',
'title' => __('Widgets 3 Columns', 'themify'),
'selected' => true),
array(
'value' => 'headerwidget-2col',
'img' => 'themify/img/sidebars/2col.png',
'title' => __('Widgets 2 Columns', 'themify')),
array(
'value' => 'headerwidget-1col',
'img' => 'themify/img/sidebars/1col.png',
'title' => __('Widgets 1 Column', 'themify')),
array(
'value' => 'none',
'img' => 'themify/img/sidebars/none.png',
'title' => __('No Widgets', 'themify'))
);
$val = themify_get( 'setting-header_widgets' );
$html .= '
' . __( 'Header Widgets', 'themify' ) . ' ';
foreach($options as $option){
if(('' == $val || !$val || !isset($val)) && isset($option['selected']) && $option['selected']){
$val = $option['value'];
}
if($val == $option['value']){
$class = 'selected';
} else {
$class = '';
}
$html .= ' ';
}
$html .= ' ';
$html .= '
';
/**
* Footer Design
* @var array
*/
$design_options = themify_theme_footer_design_options();
/**
* Prefix for theme settings
* @var string
*/
$key = 'setting-footer_design';
// Store items to hide
$html .= '';
/**
* Footer Design
*/
$html .= '
' . __( 'Footer Design', 'themify' ) . ' ';
$val = themify_get( $key, 'footer-horizontal-left',true);
foreach ( $design_options as $option ) {
if( $option['value'] === 'default' ) {
continue;
} elseif( $option['value'] === 'footer-block' ) {
$option['selected'] = true;
}
if ( ( '' == $val || ! $val ) && $option['selected'] ) {
$val = $option['value'];
}
$class = ( $val == $option['value'] ) ? 'selected' : '';
$html .= ' ';
}
$html .= '
';
// Exclusions
$key = 'setting-exclude_';
/**
* Exclude Site Logo
*/
$html .= sprintf('
%3$s
',
$key . 'footer_site_logo',
checked( themify_get( $key . 'footer_site_logo' ), 'on', false ),
__('Exclude Site Logo', 'themify')
);
/**
* Exclude Footer Widgets
*/
$html .= sprintf('
%3$s
',
$key . 'footer_widgets',
checked( themify_get( $key . 'footer_widgets' ), 'on', false ),
__('Exclude Footer Widgets', 'themify')
);
/**
* Exclude Menu Navigation
*/
$html .= sprintf('
%3$s
',
$key . 'footer_menu_navigation',
checked( themify_get( $key . 'footer_menu_navigation' ), 'on', false ),
__('Exclude Menu Navigation', 'themify')
);
/**
* Exclude Footer Texts
*/
$html .= sprintf('
%3$s
',
$key . 'footer_texts',
checked( themify_get( $key . 'footer_texts' ), 'on', false ),
__('Exclude Footer Text', 'themify')
);
/**
* Exclude Footer Back to Top
*/
$html .= sprintf('
%3$s
',
$key . 'footer_back',
checked( themify_get( $key . 'footer_back' ), 'on', false ),
__('Exclude Back to Top button', 'themify')
);
/**
* Use Floating Back to Top
* The hidden input is required for the default value
*/
$html .= sprintf('
%3$s
',
'setting-use_float_back',
checked( themify_get( 'setting-use_float_back', 'on' ), 'on', false ),
__('Use Floating Back to Top Button', 'themify')
);
/**
* Revealing footer
*/
$html .= sprintf('
%3$s
',
'setting-revealing_footer',
checked( themify_get( 'setting-revealing_footer' ), 'on', false ),
__( 'Enable Revealing Footer', 'themify' )
);
$options = array(
array(
'value' => 'footerwidget-4col',
'img' => 'themify/img/sidebars/4col.png',
'title' => __('Widgets 4 Columns', 'themify')),
array(
'value' => 'footerwidget-3col',
'img' => 'themify/img/sidebars/3col.png',
'title' => __('Widgets 3 Columns', 'themify'),
'selected' => true),
array(
'value' => 'footerwidget-2col',
'img' => 'themify/img/sidebars/2col.png',
'title' => __('Widgets 2 Columns', 'themify')),
array(
'value' => 'footerwidget-1col',
'img' => 'themify/img/sidebars/1col.png',
'title' => __('Widgets 1 Column', 'themify')),
array(
'value' => 'none_widget',
'img' => 'themify/img/sidebars/none.png',
'title' => __('None Widgets', 'themify'))
);
$val = themify_get( 'setting-footer_widgets','',true );
$html .= '
' . __( 'Footer Widgets', 'themify' ) . ' ';
foreach($options as $option){
if(('' == $val || !$val || !isset($val)) && isset($option['selected']) && $option['selected']){
$val = $option['value'];
}
if($val == $option['value']){
$class = 'selected';
} else {
$class = '';
}
$html .= ' ';
}
$html .= ' ';
$html .= '
';
// Footer widget position
$key = 'setting-footer_widget_position';
$html .= '
' . __( 'Footer Widgets Position', 'themify' ) . ' ';
$html.='' . themify_options_module( array(
array( 'name' => __( 'After Footer Text', 'themify' ), 'value' => '' ),
array( 'name' => __( 'Before Footer Text', 'themify' ), 'value' => 'top' ),
), $key ) . '
';
// Rounded Corners
$key = 'setting-rounded_corners_';
$html .= sprintf('
%1$s %4$s
',
__('Rounded Corners', 'themify'),
$key . 'images',
checked( themify_get( $key . 'images',null,true ), 'on', false ),
__('Reset rounded corners on featured images and containers', 'themify')
);
$html .= sprintf('
%3$s
',
$key . 'inputs',
checked( themify_get( $key . 'inputs',null,true ), 'on', false ),
__('Reset rounded corners on form inputs/buttons', 'themify')
);
// End group of elements to hide
$html .= '
';
$html .= ''.__('Icons','themify').' ';
$icons=array('cart'=>__('Cart','themify'),'search'=>__('Search','themify'),'blogc'=>__('Blog Comment','themify'));
foreach($icons as $ic=>$label){
$key='setting-ic-'.$ic;
$html.=''.$label.' ';
$html.='
'.__( 'Insert Icon', 'themify' ).'
';
}
return $html;
}
/**
* Markup for theme dark mode options
* @param array $data
* @return string
*/
function themify_theme_dark_mode_controls( $data = array() ) {
$key = 'setting-dark_mode_';
$html = sprintf('%1$s %4$s
',
__('Dark Mode', 'themify'),
$key . 'enabled',
checked( themify_get( $key . 'enabled',null,true ), 'on', false ),
__('Enable dark mode', 'themify')
);
$time=themify_get( $key . 'time',null,true );
$html .= sprintf(' %3$s %5$s %7$s
',
$key . 'time',
checked( $time, 'always', false ),
__('All time', 'themify'),
checked( $time, 'schedule', false ),
__('Schedule', 'themify'),
checked( $time, 'user', false ),
__('Show toggle button on header', 'themify'),
$key . 'enabled'
);
$html .= sprintf(' %3$s %6$s
',
$key . 'start',
themify_get( $key . 'start','',true ),
__('Start time(eg. 20:00)', 'themify'),
$key . 'end',
themify_get( $key . 'end','',true ),
__('End time(eg. 07:00)', 'themify'),
$key . 'time'
);
return $html;
}
/**
* Markup for several color pickers module
* @param array $data
* @return string
*/
function themify_color_pickers_module( $data = array() ) {
/**
* Variable key in theme settings
* @var string
*/
$key = '';
/**
* Module markup
* @var string
*/
$html = ''. __( 'The animating background colors can be enabled in header and footer. You can also insert in Builder row by adding "animated-bg" in Builder Row > Options > Additional CSS Class.', 'themify' ) .'
';
// Color animation control for header
$key = 'setting-header_color_animation_enabled';
$html .= sprintf(' %3$s
',
$key,
checked( themify_get( $key,'',true ), 'on', false ),
__( 'Enable animated colors in header.', 'themify' )
);
// Color animation control for footer
$key = 'setting-footer_color_animation_enabled';
$html .= sprintf(' %3$s
',
$key,
checked( themify_get( $key,'',true ), 'on', false ),
__( 'Enable animated colors in footer.', 'themify' )
);
$html .= '';
// Color animation speed
$key = 'setting-color_animation_speed';
$speed = themify_get( $key,'5',true );
$html .= '
' . __( 'Animation Speed', 'themify' ) . '
' . __( 'Enter the speed in seconds (example: 5)', 'themify' ) . '
';
// Create color pickers
$key = 'setting-color_stop_';
for ( $i = 1; $i <= 7; $i++ ) {
$html .= '
';
}
$html .= '
';
return $html;
}
/**
* Image Filter Module
* @param array $data Theme settings data
* @return string Markup for module.
* @since 1.0.0
*/
function themify_image_filter( $data = array() ) {
$data = themify_get_data();
/**
* Theme Settings Option Key Prefix
*
* @var string
*/
$key = 'setting-imagefilter_options';
/**
* Module markup
* @var string
*/
$out = '
' . __( 'Image Filter', 'themify' ) . '
' . themify_options_module( array(
array( 'name' => __( 'None', 'themify' ), 'value' => '' ),
array( 'name' => __( 'Grayscale', 'themify' ), 'value' => 'grayscale' ),
array( 'name' => __( 'Sepia', 'themify' ), 'value' => 'sepia' ),
array( 'name' => __( 'Blur', 'themify' ), 'value' => 'blur' ),
), $key ) . '
';
$out .= '
' . __( 'Image Hover Filter', 'themify' ) . '
' . themify_options_module( array(
array( 'name' => __( 'None', 'themify' ), 'value' => '' ),
array( 'name' => __( 'Grayscale', 'themify' ), 'value' => 'grayscale' ),
array( 'name' => __( 'Sepia', 'themify' ), 'value' => 'sepia' ),
array( 'name' => __( 'Blur', 'themify' ), 'value' => 'blur' ),
), $key . '_hover' ) . '
';
$key1 = 'setting-imagefilter_applyto';
$preset = themify_check( $key1,'featuredonly' ) ;
$out .= '
' . __( 'Apply to', 'themify' ) . ' ' .
sprintf(' %4$s ',
$key1.'_1',$key1, checked( $preset, 'featuredonly', false ), __( 'Featured Images Only', 'themify' ) ) .
'
' .
sprintf(' %4$s ',
$key1.'_2',$key1, checked( themify_get( $key1 ), 'allimages', false ), __( 'All Images', 'themify' ) ) . '
';
return $out;
}
/**
* Markup for related posts module
* @param array $data
* @return string
*/
function themify_related_posts( $data = array() ) {
/**
* Variable key in theme settings
* @var string
*/
$key = 'setting-relationship_taxonomy';
$options = array(
array( 'value' => 'category', 'name' => __( 'Category', 'themify' ) ),
array( 'value' => 'tag', 'name' => __( 'Tags', 'themify' ) )
);
/**
* Post content display options
* @var array
*/
$display_content_options = array(
array( 'name' => __( 'Full Content', 'themify' ), 'value' => 'content' ),
array( 'name' => __( 'Excerpt', 'themify' ), 'value' => 'excerpt' ),
array( 'name' => __( 'None', 'themify' ), 'value' => 'none', )
);
$number = themify_get( $key . '_entries',3 );
/**
* Module markup
* @var string
*/
$html = '';
$val = themify_get( $key . '_enabled',themify_get($key,null,true),true );
$html .= '
' . __( 'Related Posts', 'themify' ) . '
'.__( 'Enabled', 'themify' ).'
'.__( 'Disabled', 'themify' ).'
';
/**
* Taxonomy to use
*/
$html .= '
' . __( 'Show Related Posts By', 'themify' ) . '
' . themify_options_module( $options, $key ) . '
';
/**
* Number of Entries
*/
$html .= '
' . __( 'Number of Entries', 'themify' ) . '
';
/**
* Featured Image Size
*/
$html .= '
' . __( 'Featured Image', 'themify' ) . '
' . esc_html__( 'width', 'themify' ) . ' (px)
' . esc_html__( 'height', 'themify' ) . ' (px)
';
/**
* Hide Image
*/
$html .= sprintf(' %3$s
',
esc_attr( $key . '_hide_image' ),
checked( themify_get( $key . '_hide_image' ), 'on', false ),
__('Hide Image', 'themify')
);
/**
* Display Content
*/
$html .= '
' . __( 'Display Content', 'themify' ) . '
' .
themify_options_module( $display_content_options, $key . '_display_content', true, 'none' ) . '
';
$html .= '
' . __( 'Post Meta', 'themify' ) . '
' . __( 'Show', 'themify' ) . '
' . __( 'Hide', 'themify' ) . '
';
return $html;
}
/**
* Default Index Layout Module
* @param array $data Theme settings data
* @return string Markup for module.
* @since 1.0.0
*/
function themify_default_layout( $data = array() ){
$data = themify_get_data();
/**
* Theme Settings Option Key Prefix
* @var string
*/
$prefix = 'setting-default_';
if ( ! isset( $data[$prefix . 'more_text'] ) || '' == $data[$prefix . 'more_text'] ) {
$more_text = __( 'More', 'themify' );
} else {
$more_text = $data[$prefix . 'more_text'];
}
/**
* Tertiary options |yes|no
* @var array
*/
$default_options = array(
array('name' => '', 'value' => ''),
array('name' => __('Yes', 'themify'), 'value' => 'yes'),
array('name' => __('No', 'themify'), 'value' => 'no')
);
/**
* Default options 'yes', 'no'
* @var array
*/
$binary_options = array(
array('name'=>__('Yes', 'themify'),'value'=>'yes'),
array('name'=>__('No', 'themify'),'value'=>'no')
);
/**
* Post content display options
* @var array
*/
$default_display_options = array(
array('name' => __('Full Content', 'themify'),'value' => 'content'),
array('name' => __('Excerpt', 'themify'),'value' => 'excerpt'),
array('name' => __('None', 'themify'),'value' => 'none')
);
$show_hide_options = array(
array('name'=>__('Show', 'themify'),'value'=>'no'),
array('name'=>__('Hide', 'themify'),'value'=>'yes'),
);
$no_yes_options = array(
array('name'=>__('No', 'themify'),'value'=>'no'),
array('name'=>__('Yes', 'themify'),'value'=>'yes'),
);
/**
* Post layout options
* @var array
*/
$default_post_layout_options = array(
array('value' => 'list-post', 'img' => 'images/layout-icons/list-post.png', 'title' => __( 'List Post', 'themify' ), "selected" => true),
array('value' => 'grid2', 'img' => 'images/layout-icons/grid2.png', 'title' => __( 'Grid 2', 'themify' )),
array('value' => 'grid3', 'img' => 'images/layout-icons/grid3.png', 'title' => __( 'Grid 3', 'themify' )),
array('value' => 'grid4', 'img' => 'images/layout-icons/grid4.png', 'title' => __( 'Grid 4', 'themify' )),
array('value' => 'grid5', 'img' => 'images/layout-icons/grid5.png','title' => __('Grid 5', 'themify')),
array('value' => 'grid6','img' => 'images/layout-icons/grid6.png','title' => __('Grid 6', 'themify')),
array('value' => 'list-large-image', 'img' => 'images/layout-icons/list-large-image.png', 'title' => __('List Large Image', 'themify')),
array('value' => 'list-thumb-image', 'img' => 'images/layout-icons/list-thumb-image.png', 'title' => __('List Thumb Image', 'themify')),
array('value' => 'grid2-thumb', 'img' => 'images/layout-icons/grid2-thumb.png', 'title' => __('Grid 2 Thumb', 'themify')),
array('value' => 'auto_tiles', 'img' => 'images/layout-icons/auto-tiles.png', 'title' => __('Tiles', 'themify'))
);
/**
* Sidebar placement options
* @var array
*/
$sidebar_location_options = themify_sidebar_location_options();
/**
* Entry media position, above or below the title
*/
$media_position = array(
array('name'=>__('Above Post Title', 'themify'), 'value'=>'above'),
array('name'=>__('Below Post Title', 'themify'), 'value'=>'below'),
);
$unlink_options = [
[ 'name' => __('Linked', 'themify'), 'value' => 'no' ],
[ 'name' => __('Unlinked', 'themify'), 'value' => 'yes' ],
];
/**
* Index Sidebar Option
*/
$output = '
' . __('Archive Sidebar Option', 'themify') . ' ';
$val = isset( $data[$prefix.'layout'] ) ? $data[$prefix.'layout'] : '';
foreach($sidebar_location_options as $option){
if(($val == '' || !$val || !isset($val)) && $option['selected']){
$val = $option['value'];
}
if($val == $option['value']){
$class = 'selected';
} else {
$class = '';
}
$output .= ' ';
}
$output .= '
';
$output .= '
'.__('Enable sticky sidebar', 'themify').'
';
/**
* Post Layout
*/
$output .= '
' . __('Post Layout', 'themify') . ' ';
$val = isset( $data[$prefix.'post_layout'] ) ? $data[$prefix.'post_layout'] : '';
foreach($default_post_layout_options as $option){
if(($val == '' || !$val || !isset($val)) && $option['selected']){
$val = $option['value'];
}
if($val == $option['value']){
$class = 'selected';
} else {
$class = '';
}
$output .= ' ';
}
$output .= '
';
/**
* Post Content Layout
*/
$output .= '
' . __( 'Post Content Layout', 'themify' ) . '
'.
themify_options_module( array(
array( 'name' => __( 'Default', 'themify' ), 'value' => '' ),
array( 'name' => __( 'Overlay', 'themify' ), 'value' => 'overlay' ),
array( 'name' => __( 'Polaroid', 'themify' ), 'value' => 'polaroid' ),
array( 'name' => __( 'Boxed', 'themify' ), 'value' => 'boxed' ),
array( 'name' => __( 'Flip', 'themify' ), 'value' => 'flip' )
), 'setting-post_content_layout' ) . '
';
/**
* Enable Post Filter
*/
$output .= '' . __( 'Post Filter', 'themify' ) . themify_help( __( 'Displayed on Category and Tag archive pages only.', 'themify' ) ) . '
'
. themify_options_module( $binary_options, 'setting-post_filter', true, 'no' ) . '
';
$output .= '
' . __( 'Display only child categories on category archive', 'themify') . '
';
/**
* Enable Masonry
*/
$output .= '
' . __('Masonry Layout', 'themify') . '
' .
themify_options_module($binary_options, 'setting-disable_masonry') . '
';
$output .= '' . __('Align Posts', 'themify') .themify_help(__( 'When masonry layout or post filter is enabled, this option will make the posts align instead of stacking.', 'themify' )) . '
';
/**
* Post Gutter
*/
$output .= '
' . __( 'Post Gutter', 'themify' ) . '
'.
themify_options_module( array(
array( 'name' => __( 'Default', 'themify' ), 'value' => 'gutter' ),
array( 'name' => __( 'No gutter', 'themify' ), 'value' => 'no-gutter' )
), 'setting-post_gutter' ) . '
';
/**
* Display Content
*/
$output .= '
' . __('Display Content', 'themify') . '
'.
themify_options_module($default_display_options, $prefix.'layout_display').'
';
/**
* Excerpt length
*/
$output .= '
'
. __( 'Excerpt length (enter number of words)', 'themify' ) . '
';
/**
* More Text
*/
$output .= '
' . __('More Text', 'themify') . '
' . __('Display more link button in excerpt mode as well.', 'themify') . '
';
/**
* Order & OrderBy Options
*/
$output .= themify_post_sorting_options('setting-index_order', $data);
/**
* Hide Post Title
*/
$output .= '
' . __('Post Title', 'themify') . '
' .
themify_options_module($show_hide_options, $prefix.'post_title') . '
';
/**
* Unlink Post Title
*/
$output .= '
' . __('Post Title Link', 'themify') . '
' .
themify_options_module($unlink_options, $prefix.'unlink_post_title') . '
';
/**
* Hide Post Meta
*/
$output .= themify_post_meta_options($prefix.'post_meta', $data);
/**
* Hide Post Date
*/
$output .= '
' . __('Post Date', 'themify') . '
' .
themify_options_module($show_hide_options, $prefix.'post_date') . '
'. __('Display post date as inline text instead of circle style', 'themify') .'
';
/**
* Auto Featured Image
*/
$output .= '
' . __('Auto Featured Image', 'themify') . '
' . __( 'If no featured image is specified, display first image in content.', 'themify' ) . '
';
/**
* Featured Image Position
*/
$output .= '
' . __( 'Featured Image Position', 'themify' ) . '
' .
themify_options_module( $media_position, $prefix.'media_position' ) . '
';
/**
* Hide Featured Image
*/
$output .= '
' . __('Featured Image', 'themify') . '
' .
themify_options_module($show_hide_options, $prefix.'post_image') . '
';
/**
* Unlink Featured Image
*/
$output .= '
' . __('Featured Image Link', 'themify') . '
' .
themify_options_module($unlink_options, $prefix.'unlink_post_image') . '
';
/**
* Featured Image Sizes
*/
$output .= themify_feature_image_sizes_select('image_post_feature_size');
/**
* Image Dimensions
*/
$output .= '
' . __('Image Size', 'themify') . '
' . __('width', 'themify') . ' (px)
' . __('height', 'themify') . ' (px)
' . __('Enter height = 0 to disable vertical cropping with img.php enabled', 'themify') . '
';
return $output;
}
if (!function_exists('themify_pagination_infinite')) {
/**
* Choose pagination or infinite scroll
* @param array $data
* @return string
*/
function themify_pagination_infinite($data = array()) {
$output = '' . __( 'Pagination Option', 'themify' ) . ' ';
//Infinite Scroll
$output .= ' ';
$output .= __('Infinite Scroll (posts are loaded on the same page)', 'themify');
$output .= '
';
$output .= ' ' . __('Disable automatic infinite scroll', 'themify').' ';
$output .= ' ';
$output .= ' ' . __('Disable page number updates on address URL on scrolling', 'themify').' ';
$output .= '
';
$output .= ' ';
//Numbered pagination
$output .= ' ';
$output .= __('Standard Pagination', 'themify') . ' ';
$output .= '';
$key = 'setting-entries_nav';
$output .= '';
return $output;
}
}
/**
* Control page loader effect in regular pages.
* @param array $data
* @return string
*/
function themify_page_section_scroll( $data = array() ) {
$out=''.__("These options are for the Builder's 'Section Scroll' feature (it is only effective when the 'Section Scroll' is selected in page's Themify Custom Panel > Page Options)",'themify').'
';
$key = 'setting-page_loader_sensitivity';
$out.= '
' . __( 'Scroll Sensitivity', 'themify' ) . '
' . themify_options_module( array(
array( 'name' => __( 'Normal', 'themify' ), 'value' => '' ),
array( 'name' => __( 'Low', 'themify' ), 'value' => 'l' ),
), $key ) . '
';
$key = 'setting-page_loader_duration';
$out.= '
' . __( 'Transition Duration', 'themify' ) . '
' . themify_options_module( array(
array( 'name' => __( 'Slow', 'themify' ), 'value' => 1.5 ),
array( 'name' => __( 'Normal', 'themify' ), 'value' => '' ),
array( 'name' => __( 'Fast ', 'themify' ), 'value' => .5 ),
array( 'name' => __( 'Custom ', 'themify' ), 'value' => 'custom' ),
), $key,true,'' ) . '
';
$key = 'setting-page_loader_duration_sec';
$out.= ' '. __( 'Second', 'themify' ) .'
';
$key = 'setting-all_page_loader';
$out .= '
'.__('Loading Screen','themify').'
' . __( 'Loading Screen Every Page', 'themify' ) . '
' . __('Enable loading screen on every page', 'themify') . '
';
$key = 'setting-page_loader_color';
$value = themify_get($key,'',true);
$out .= '
' . __('Loading Screen Color', 'themify') . '
';
$key = 'setting-page_loader_icon';
$value = themify_get($key,'',true);
$out.='';
return $out;
}
/**
* Settings for the slider in single post pages
*
* @since 1.4.5
*/
function single_post_slider_settings() {
$output = ''. __( 'The slider options below apply to the single post slider layout (it is effective when slider layout is selected at the post\'s Themify Custom Panel > Post Options > Post Layout.', 'themify' ) .'
';
$output .= '
' . __( 'Autoplay', 'themify' ) . '
'.
themify_options_module( array(
array( 'name' => __( 'Off', 'themify' ), 'value' => 'off' ),
array( 'name' => __( '1 Second', 'themify' ), 'value' => '1' ),
array( 'name' => __( '2 Seconds', 'themify' ), 'value' => '2' ),
array( 'name' => __( '3 Seconds', 'themify' ), 'value' => '3' ),
array( 'name' => __( '4 Seconds', 'themify' ), 'value' => '4' ),
array( 'name' => __( '5 Seconds', 'themify' ), 'value' => '5' ),
array( 'name' => __( '6 Seconds', 'themify' ), 'value' => '6' ),
array( 'name' => __( '7 Seconds', 'themify' ), 'value' => '7' ),
array( 'name' => __( '8 Seconds', 'themify' ), 'value' => '8' ),
array( 'name' => __( '9 Seconds', 'themify' ), 'value' => '9' ),
array( 'name' => __( '10 Seconds', 'themify' ), 'value' => '10' ),
), 'setting-single_slider_autoplay' ) . '
';
$output .= '
' . __( 'Transition Speed', 'themify' ) . '
'.
themify_options_module( array(
array( 'name' => __( 'normal', 'themify' ), 'value' => 'normal' ),
array( 'name' => __( 'Slow', 'themify' ), 'value' => 'slow' ),
array( 'name' => __( 'Fast', 'themify' ), 'value' => 'fast' ),
), 'setting-single_slider_speed' ) . '
';
$output .= '
' . __( 'Effect', 'themify' ) . '
'.
themify_options_module( array(
array( 'name' => __( 'Slide', 'themify' ), 'value' => 'slide' ),
array( 'name' => __( 'Fade', 'themify' ), 'value' => 'fade' ),
array( 'name' => __( 'Crossfade', 'themify' ), 'value' => 'crossfade' ),
array( 'name' => __( 'Cover', 'themify' ), 'value' => 'cover' ),
array( 'name' => __( 'Cover Fade', 'themify' ), 'value' => 'cover-fade' ),
array( 'name' => __( 'Uncover', 'themify' ), 'value' => 'uncover' ),
array( 'name' => __( 'Uncover Fade', 'themify' ), 'value' => 'uncover-fade' ),
array( 'name' => __( 'Continuously', 'themify' ), 'value' => 'continuously' ),
), 'setting-single_slider_effect' ) . '
';
$output .= '
' . __( 'Slider Height', 'themify' ) .themify_help(__( '"Auto" measures the highest slide and all other slides will be set to that size. "Variable" makes every slide has it\'s own height', 'themify' )) . '
'.
themify_options_module( array(
array( 'name' => __( 'Auto', 'themify' ), 'value' => 'auto' ),
array( 'name' => __( 'Variable', 'themify' ), 'value' => 'variable' ),
), 'setting-single_slider_height' ) . '
';
return $output;
}
/* WooCommerce additional options */
/**
* Creates module for general shop layout and settings
* @param array
* @return string
* @since 1.5.1
*/
function themify_shop_layout( $data = array() ){
$data = themify_get_data();
$options = array(
array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'selected' => true, 'title' => __('Sidebar Right', 'themify')),
array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')),
array('value' => 'sidebar2', 'img' => 'images/layout-icons/sidebar2.png', 'title' => __('Left and Right', 'themify')),
array('value' => 'sidebar2 content-left', 'img' => 'images/layout-icons/sidebar2-content-left.png', 'title' => __('2 Right Sidebars', 'themify')),
array('value' => 'sidebar2 content-right', 'img' => 'images/layout-icons/sidebar2-content-right.png', 'title' => __('2 Left Sidebars', 'themify')),
array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar', 'themify')),
array('value' => 'full_width', 'img' => 'themify/img/fullwidth.svg', 'title' => __('Fullwidth (Builder Page)', 'themify')),
);
/**
* Entries layout options
* @var array
*/
$default_entry_layout_options = array(
array('value' => 'list-post', 'img' => 'images/layout-icons/list-post.png', 'title' => __('List Post', 'themify')),
array('value' => 'grid2', 'img' => 'images/layout-icons/grid2.png', 'title' => __('Grid 2', 'themify')),
array('value' => 'grid3', 'img' => 'images/layout-icons/grid3.png', 'title' => __('Grid 3', 'themify')),
array('value' => 'grid4', 'img' => 'images/layout-icons/grid4.png', 'title' => __('Grid 4', 'themify'), 'selected' => true),
array('value' => 'grid5', 'img' => 'images/layout-icons/grid5.png','title' => __('Grid 5', 'themify')),
array('value' => 'grid6','img' => 'images/layout-icons/grid6.png','title' => __('Grid 6', 'themify'))
);
$default_options = array(
'' => '',
__('Hide', 'themify') => 'yes',
__('Show', 'themify') => 'no'
);
$binary_options = array(
array('name'=>__('Yes', 'themify'),'value'=>'yes'),
array('name'=>__('No', 'themify'),'value'=>'no')
);
$content_options = array(
__('None', 'themify') => '',
__('Short Description', 'themify') => 'excerpt',
__('Full Content', 'themify') => 'content'
);
$val = isset( $data['setting-shop_layout'] ) ? $data['setting-shop_layout'] : '';
$output = '';
/**
* Sidebar option
*/
$output .= '' . __('Shop Page Sidebar', 'themify') . ' ';
foreach ( $options as $option ) {
if ( ( '' == $val || ! $val || ! isset( $val ) ) && ( isset( $option['selected'] ) && $option['selected'] ) ) {
$val = $option['value'];
}
if ( $val == $option['value'] ) {
$class = "selected";
} else {
$class = "";
}
$output .= ' ';
}
$output .= '
';
$output .= '
'.__('Enable sticky sidebar ', 'themify').'
';
$output .= shop_archive_layout();
$output .= '
'.__('Enable sticky sidebar on product archive', 'themify').'
';
/**
* Entries Layout
*/
$output .= '
' . __('Product Layout', 'themify') . ' ';
$val = isset( $data['setting-products_layout'] ) ? $data['setting-products_layout'] : '';
foreach($default_entry_layout_options as $option){
if ( ( '' == $val || ! $val || ! isset( $val ) ) && ( isset( $option['selected'] ) && $option['selected'] ) ) {
$val = $option['value'];
}
if ( $val == $option['value'] ) {
$class = 'selected';
} else {
$class = '';
}
$output .= ' ';
}
$output .= '
';
/**
* Enable Masonry
*/
$output .= '
' . __('Masonry Layout', 'themify') . '
' .
themify_options_module($binary_options, 'setting-product_disable_masonry') . '
';
$output .= '' . __('Align Products', 'themify') .themify_help(__( 'When masonry layout is enabled, this option will make the products align instead of stacking.', 'themify' )) . '
';
/**
* Product Content Style
*/
$output .= '
' . __( 'Product Content Style', 'themify' ) . '
'.
themify_options_module( array(
array( 'name' => __( 'Default', 'themify' ), 'value' => '' ),
array( 'name' => __( 'Overlay', 'themify' ), 'value' => 'overlay' ),
array( 'name' => __( 'Polaroid', 'themify' ), 'value' => 'polaroid' ),
array( 'name' => __( 'Boxed', 'themify' ), 'value' => 'boxed' ),
array( 'name' => __( 'Flip', 'themify' ), 'value' => 'flip' )
), 'setting-product_content_layout' ) . '
';
$output .= '' . __('Product Image Hover', 'themify') . '
' . __('Use first product gallery image as hover image', 'themify') . '
';
$output .= '' . __('Products Per Page', 'themify') . '
';
$hide = '';
$sel=themify_get( 'setting-product_archive_hide_title',false,true );
foreach($default_options as $name => $option){
$selected=$sel === $option?' selected="selected"':'';
$hide .= ''.$name.' ';
}
$output .= '
' . __('Product Title', 'themify') . '
'.$hide.'
';
$hide = '';
$sel=themify_get( 'setting-product_archive_hide_price',false,true );
foreach($default_options as $name => $option){
$selected=$sel === $option?' selected="selected"':'';
$hide .= ''.$name.' ';
}
$output .= '
' . __('Product Price', 'themify') . '
'.$hide.'
';
/**
* Hide Add to Cart Button
* @var String
*/
$hide = '';
$sel=themify_get( 'setting-product_archive_hide_cart_button',false,true );
foreach($default_options as $name => $option){
$selected=$sel === $option?' selected="selected"':'';
$hide .= ''.$name.' ';
}
$output .= '
' . __('Add to Cart Button', 'themify') . '
'.$hide.'
';
$output .= '' . __('Breadcrumbs Navigation', 'themify') . '
' . __('Hide shop breadcrumbs navigation', 'themify') . '
';
$output .= '' . __('Shop Page Products', 'themify') . '
' . __('Hide products on shop page', 'themify') . '
' . __('Warning: no products will show on the Shop page. Only enable this option if you want to use Woo Products addon for a custom shop page layout.', 'themify') . '
';
$output .= '' . __('Product Count', 'themify') . '
' . __('Hide product count', 'themify') . '
';
$output .= '' . __('Product Sorting', 'themify') . '
' . __('Hide product sorting select', 'themify') . '
';
/**
* Show product rating stars
*/
$output .= '' . __('Rating Stars', 'themify') . '
' . __('Hide product rating stars', 'themify') . '
';
/**
* Product Reviews (Always show them even empty ones)
*/
$output .= '
'.__('Always show rating stars (even when it has no rating)', 'themify').'
';
$hide = '';
$sel=themify_get( 'setting-product_archive_show_short',false,true );
foreach($content_options as $name => $option){
$selected=$sel === $option?' selected="selected"':'';
$hide .= ''.$name.' ';
}
$output .= '
' . __('Product Description', 'themify') . '
'.$hide.'
';
/**
* Shop Image Dimensions
*/
$output .= '' . __('Image Size', 'themify') . '
'. __( 'Woocommerce Settings', 'themify' ) . '
'. __( 'Custom Size', 'themify' ) . '
';
$output .= '
' . __('width', 'themify') . ' (px)
' . __('height', 'themify') . ' (px)
' . __('Enter height = 0 to disable vertical cropping with img.php enabled', 'themify') . '
';
return $output;
}
/**
* Creates module for single product settings
* @param array
* @return string
* @since 1.5.1
*/
function themify_single_product( $data = array() ){
$data = themify_get_data();
$options = array(
array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'selected' => true, 'title' => __('Sidebar Right', 'themify')),
array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')),
array('value' => 'sidebar2', 'img' => 'images/layout-icons/sidebar2.png', 'title' => __('Left and Right', 'themify')),
array('value' => 'sidebar2 content-left', 'img' => 'images/layout-icons/sidebar2-content-left.png', 'title' => __('2 Right Sidebars', 'themify')),
array('value' => 'sidebar2 content-right', 'img' => 'images/layout-icons/sidebar2-content-right.png', 'title' => __('2 Left Sidebars', 'themify')),
array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar', 'themify')),
array('value' => 'full_width', 'img' => 'themify/img/fullwidth.svg', 'title' => __('Fullwidth (Builder Page)', 'themify')),
);
$default_options = array(
array('name' => '', 'value' => ''),
array('name' => __('Hide', 'themify'), 'value' => 'yes'),
array('name' => __('Show', 'themify'), 'value' => 'no')
);
$val = isset( $data['setting-single_product_layout'] ) ? $data['setting-single_product_layout'] : '';
/**
* HTML for settings panel
* @var string
*/
$output = '' . __('Product Sidebar Option', 'themify') . ' ';
foreach ( $options as $option ) {
if ( ( '' == $val || ! $val || ! isset( $val ) ) && ( isset( $option['selected'] ) && $option['selected'] ) ) {
$val = $option['value'];
}
if ( $val == $option['value'] ) {
$class = "selected";
} else {
$class = "";
}
$output .= ' ';
}
$output .= '
';
$output .= '
'.__('Enable sticky sidebar', 'themify').'
';
/**
* Image Dimensions
*/
$output .= '' . __('Image Size', 'themify') . '
'. __( 'Woocommerce Settings', 'themify' ) . '
'. __( 'Custom Size', 'themify' ) . '
';
$output .= '
' . __('width', 'themify') . ' (px)
' . __('height', 'themify') . ' (px)
' . __('Enter height = 0 to disable vertical cropping with img.php enabled', 'themify') . '
';
/**
* Hide Breadcrumbs
* @var String
*/
$output .= '' . __('Shop Breadcrumbs', 'themify') . '
' . __('Hide shop breadcrumbs', 'themify') . '
';
/**
* Disable Product Image zoom
*/
$output .= '' . __('Image Zoom', 'themify') . '
' . __('Disable product image zoom', 'themify') . '
';
/**
* Product Reviews
*/
$output .= '' . __('Product Reviews', 'themify') . '
' . __('Disable product reviews', 'themify') . '
';
/**
* Product Reviews (Always show them even empty ones)
*/
$output .= '
'.__('Always show rating stars (even when it has no rating)', 'themify').'
';
/**
* Related Products
*/
$output .= '' . __('Related Products', 'themify') . '
' . __('Do not display related products', 'themify') . '
';
$output .= '' . __('Related Products Limit', 'themify') . '
';
/**
* Related Image Dimensions
*/
$output .= '
' . __('Related Products Image Size', 'themify') . '
' . __('width', 'themify') . ' (px)
' . __('height', 'themify') . ' (px)
' . __('Enter height = 0 to disable vertical cropping with img.php enabled', 'themify') . '
';
/**
* Product description Display
*/
$output .= '' . __('Builder Content Display', 'themify') . ' ';
$output .= '';
$output .= ' ';
$output .= __( 'In Long Description', 'themify' ) . ' ';
$output .= '';
$output .= ' ';
$output .= __( 'In Short Description', 'themify' ) . ' ';
$output .= '
';
/**
* Sticky Buy Button
*/
$output .= '' . __('Sticky Buy Button', 'themify') . '
' . __('Disable sticky buy button', 'themify') . '
';
/**
* Description & Reviews Layout
*/
$output .= '' . __('Description & Reviews', 'themify') . ' ';
$output .= '';
$output .= ' ';
$output .= __('Tabs', 'themify') . ' ';
$output .= '';
$output .= ' ';
$output .= __('Accordion', 'themify') . ' ';
$output .= '';
$output .= ' ';
$output .= __('None', 'themify') . ' ';
$output .= '
';
return $output;
}
/**
* Creates module for general archive layout
* @param array $data
* @return string
* @since 1.5.1
*/
function shop_archive_layout( $data = array() ) {
$data = themify_get_data();
/**
* Sidebar option
*/
$val = isset( $data['setting-shop_archive_layout'] ) ? $data['setting-shop_archive_layout'] : '';
$options = array(
array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'title' => __('Sidebar Right', 'themify')),
array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')),
array('value' => 'sidebar2', 'img' => 'images/layout-icons/sidebar2.png', 'title' => __('Left and Right', 'themify')),
array('value' => 'sidebar2 content-left', 'img' => 'images/layout-icons/sidebar2-content-left.png', 'title' => __('2 Right Sidebars', 'themify')),
array('value' => 'sidebar2 content-right', 'img' => 'images/layout-icons/sidebar2-content-right.png', 'title' => __('2 Left Sidebars', 'themify')),
array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png','selected' => true, 'title' => __('No Sidebar', 'themify')),
array('value' => 'full_width', 'img' => 'themify/img/fullwidth.svg', 'title' => __('Fullwidth (Builder Page)', 'themify'))
);
$html= '' . __('Product Archive Sidebar', 'themify') . ' ';
foreach ( $options as $option ) {
if ( ( '' == $val || ! $val || ! isset( $val ) ) && ( isset( $option['selected'] ) && $option['selected'] ) ) {
$val = $option['value'];
}
$class = $val == $option['value'] ?"selected":"";
$html.= ' ';
}
$html.= '
';
return $html;
}
if (!function_exists('themify_search_result_layout')) {
/**
* Default Index Layout Module
* @param array $data Theme settings data
* @return string Markup for module.
* @since 1.0.0
*/
function themify_search_result_layout( $data = array() ){
$data = themify_get_data();
$prefix = 'setting-search-result_';
$setting = 'setting-search-';
$show_hide_options = array(
array('name'=>__('Show', 'themify'),'value'=>'no'),
array('name'=>__('Hide', 'themify'),'value'=>'yes'),
);
$no_yes_options = array(
array('name'=>__('No', 'themify'),'value'=>'no'),
array('name'=>__('Yes', 'themify'),'value'=>'yes'),
);
$unlink_options = [
[ 'name' => __('Linked', 'themify'), 'value' => 'no' ],
[ 'name' => __('Unlinked', 'themify'), 'value' => 'yes' ],
];
/**
* Index Sidebar Option
*/
$output = '
' . __('Search Sidebar Option', 'themify') . ' ';
$val = isset( $data[$prefix.'layout'] ) ? $data[$prefix.'layout'] : '';
$output .= themify_render_option_items( themify_sidebar_location_options(), $val );
$output .= '
';
$output .= '
'.__('Enable sticky sidebar', 'themify').'
';
/**
* Post Layout
*/
$output .= '
' . __('Post Layout', 'themify') . ' ';
$val = isset( $data[$prefix.'post_layout'] ) ? $data[$prefix.'post_layout'] : '';
$output .= themify_render_option_items( themify_default_post_layout_options(), $val);
$output .= '
';
/**
* Post Content Layout
*/
$output .= '
' . __( 'Post Content Layout', 'themify' ) . '
'.
themify_options_module( themify_content_layout(), esc_attr($setting).'post_content_layout' ) . '
';
/**
* Display Content
*/
$output .= '
' . __('Display Content', 'themify') . '
'.
themify_options_module(themify_default_display_options(), esc_attr($prefix).'layout_display',true,'excerpt' ).'
';
/**
* Hide Post Title
*/
$output .= '
' . __('Post Title', 'themify') . '
' .themify_options_module( $show_hide_options, $prefix.'post_title') . '
';
/**
* Unlink Post Title
*/
$output .= '
' . __('Post Title Link', 'themify') . '
' .themify_options_module( $unlink_options, $prefix.'unlink_post_title') . '
';
/**
* Hide Post Meta
*/
$output .= themify_post_meta_options($prefix.'post_meta', $data);
/**
* Hide Post Date
*/
$output .= '
' . __('Post Date', 'themify') . '
' .
themify_options_module( $show_hide_options, $prefix.'post_date') . '
'. __('Display post date as inline text instead of circle style', 'themify') .'
';
/**
* Auto Featured Image
*/
$output .= '
' . __('Auto Featured Image', 'themify') . '
' . __( 'If no featured image is specified, display first image in content.', 'themify' ) . '
';
/**
* Featured Image Position
*/
$output .= '
' . __( 'Featured Image Position', 'themify' ) . '
' .
themify_options_module( themify_media_position(), $prefix.'media_position' ) . '
';
/**
* Hide Featured Image
*/
$output .= '
' . __('Featured Image', 'themify') . '
' .
themify_options_module( $show_hide_options, $prefix.'post_image') . '
';
/**
* Unlink Featured Image
*/
$output .= '
' . __('Featured Image Link', 'themify') . '
' .
themify_options_module( $unlink_options, $prefix.'unlink_post_image') . '
';
/**
* Featured Image Sizes
*/
$output .= themify_feature_image_sizes_select('image_post_feature_size');
/**
* Image Dimensions
*/
$output .= '
' . __('Image Size', 'themify') . '
' . __('width', 'themify') . ' (px)
' . __('height', 'themify') . ' (px)
' . __('Enter height = 0 to disable vertical cropping with img.php enabled', 'themify') . '
';
return $output;
}
}
/**
* @return array
*/
function themify_post_gutter(){
return array(
array('name' => __('Default', 'themify'), 'value' => 'gutter'),
array('name' => __('No gutter', 'themify'), 'value' => 'no-gutter')
);
}
/**
* @return array
*/
function themify_content_layout(){
return array(
array('name' => __('Default', 'themify'), 'value' => ''),
array('name' => __('Overlay', 'themify'), 'value' => 'overlay'),
array('name' => __('Polaroid', 'themify'), 'value' => 'polaroid'),
array('name' => __('Boxed', 'themify'), 'value' => 'boxed'),
array('name' => __('Flip', 'themify'), 'value' => 'flip')
);
}
/**
* @return array
*/
function themify_media_position(){
return array(
array('name' => __('Above Post Title', 'themify'), 'value' => 'above'),
array('name' => __('Below Post Title', 'themify'), 'value' => 'below'),
);
}
/**
* @return array
*/
function themify_sidebar_location_options(){
return array(
array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'selected' => true, 'title' => __('Sidebar Right', 'themify')),
array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')),
array('value' => 'sidebar2', 'img' => 'images/layout-icons/sidebar2.png', 'title' => __('Left and Right', 'themify')),
array('value' => 'sidebar2 content-left', 'img' => 'images/layout-icons/sidebar2-content-left.png', 'title' => __('2 Right Sidebars', 'themify')),
array('value' => 'sidebar2 content-right', 'img' => 'images/layout-icons/sidebar2-content-right.png', 'title' => __('2 Left Sidebars', 'themify')),
array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar', 'themify')),
array('value' => 'full_width', 'img' => 'themify/img/fullwidth.svg', 'title' => __('Fullwidth (Builder Page)', 'themify')),
);
}
/**
* @return array
*/
function themify_default_post_layout_options(){
return array(
array('value' => 'list-post', 'img' => 'images/layout-icons/list-post.png', 'title' => __('List Post', 'themify'), "selected" => true),
array('value' => 'grid2', 'img' => 'images/layout-icons/grid2.png', 'title' => __('Grid 2', 'themify')),
array('value' => 'grid3', 'img' => 'images/layout-icons/grid3.png', 'title' => __('Grid 3', 'themify')),
array('value' => 'grid4', 'img' => 'images/layout-icons/grid4.png', 'title' => __('Grid 4', 'themify')),
array('value' => 'grid5', 'img' => 'images/layout-icons/grid5.png','title' => __('Grid 5', 'themify')),
array('value' => 'grid6','img' => 'images/layout-icons/grid6.png','title' => __('Grid 6', 'themify')),
array('value' => 'list-large-image', 'img' => 'images/layout-icons/list-large-image.png', 'title' => __('List Large Image', 'themify')),
array('value' => 'list-thumb-image', 'img' => 'images/layout-icons/list-thumb-image.png', 'title' => __('List Thumb Image', 'themify')),
array('value' => 'grid2-thumb', 'img' => 'images/layout-icons/grid2-thumb.png', 'title' => __('Grid 2 Thumb', 'themify')),
array('value' => 'auto_tiles', 'img' => 'images/layout-icons/auto-tiles.png', 'title' => __('Tiles', 'themify'))
);
}
/**
* @return array
*/
function themify_default_display_options(){
return array(
array('name' => __('Full Content', 'themify'), 'value' => 'content'),
array('name' => __('Excerpt', 'themify'), 'value' => 'excerpt'),
array('name' => __('None', 'themify'), 'value' => 'none')
);
}
/**
* @return array
*/
function themify_binary_options(){
return array(
array('name' => __('Hide', 'themify'), 'value' => 'yes'),
array('name' => __('Show', 'themify'), 'value' => 'no')
);
}
/**
* Tertiary options |yes|no
* @var array
*/
function themify_default_options(){
return array(
array('name' => '', 'value' => ''),
array('name' => __('Hide', 'themify'), 'value' => 'yes'),
array('name' => __('Show', 'themify'), 'value' => 'no')
);
}
function themify_render_option_items(array $item_list, $val ){
$output = '';
foreach ($item_list as $option) {
if (($val == '' || !$val || !isset($val)) && $option['selected']) {
$val = $option['value'];
}
if ($val == $option['value']) {
$class = 'selected';
} else {
$class = '';
}
$output .= ' ';
}
return $output;
}
function themify_extend_mega_menu_options($out){
$key = 'setting-mega_menu';
$out .= '
' . __( 'Post Count', 'themify' ) . '
' . __('Include post count on category links', 'themify') . '
';
return $out;
}
add_filter('themify_mega_menu_settings','themify_extend_mega_menu_options');
if(themify_is_woocommerce_active()){
function themify_add_serach_post_type_option($out){
$out = '' . __('Search Post Type', 'themify') . '
'. __( 'All', 'themify' ) . '
'. __( 'Product', 'themify' ) . '
'.$out;
return $out;
}
add_filter('themify_search_settings_output','themify_add_serach_post_type_option');
}