|yes|no
* @var array
*/
$default_options = array(
array('name' => '', 'value' => ''),
array('name' => __('Yes', 'themify'), 'value' => 'yes'),
array('name' => __('No', 'themify'), 'value' => 'no')
);
$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'),
);
/**
* Sidebar placement options
* @var array
*/
$sidebar_location_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')),
);
/**
* Post Layout options
* @var array
*/
$post_layout = array(
array('selected' => true, 'value' => 'classic', 'img' => 'images/layout-icons/post-classic.png', 'title' => __('Classic', 'themify')),
array('value' => 'fullwidth', 'img' => 'images/layout-icons/post-fullwidth.png', 'title' => __('Fullwidth', 'themify')),
array('value' => 'slider', 'img' => 'images/layout-icons/post-slider.png', 'title' => __('Slider', 'themify')),
array('value' => 'gallery', 'img' => 'images/layout-icons/post-gallery.png', 'title' => __('Gallery', 'themify')),
array('value' => 'split', 'img' => 'images/layout-icons/post-split.png', 'title' => __('Split', 'themify'))
);
/**
* Image alignment options
* @var array
*/
$alignment_options = array(
array('name' => '', 'value' => ''),
array('name' => __('Left', 'themify'), 'value' => 'left'),
array('name' => __('Right', 'themify'), 'value' => 'right')
);
/**
* 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' ],
];
/**
* Module markup
* @var string
*/
$output = '';
/**
* Post sidebar placement
*/
$output .= '
' . __('Post Sidebar Option', 'themify') . ' ';
$val = themify_get($prefix . 'post_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 placement
*/
$output .= '
' . __('Post Layout', 'themify') . ' ';
$val = themify_get($prefix . 'post_layout_type');
foreach ($post_layout 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 .= '
';
/**
* 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') . '
';
/**
* Featured Image Position
*/
$output .= '
' . __('Featured Image Position', 'themify') . '
' .
themify_options_module($media_position, $prefix . 'single_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_single_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') . '
';
/**
* Disable comments
*/
$pre = 'setting-comments_posts';
$comments_posts_checked = themify_check($pre) ? 'checked="checked"' : '';
$output .= '' . __('Post Comments', 'themify') . ' ' . __('Disable comments in all Posts', 'themify') . '
';
/**
* Show author box
*/
$pre = 'setting-post_author_box';
$author_box_checked = themify_check($pre) ? 'checked="checked"' : '';
$output .= '' . __('Show Author Box', 'themify') . ' ' . __('Show author box in all Posts', 'themify') . '
';
/**
* Remove Post Navigation
*/
$pre = 'setting-post_nav_';
$output .= '
' . __('Post Navigation', 'themify') . '
' . __('Remove Post Navigation', 'themify') . '
' . __('Show only posts in the same category', 'themify') . '
';
/**
* Single post infinite scroll
*/
$pre = 'setting-infinite_single_posts';
$infinite_posts_checked = themify_check($pre) ? 'checked="checked"' : '';
$output .= '' . __('Single Post Infinite Scroll', 'themify') .themify_help(__('The next post will load automatically when user scrolls to the end of the post.', 'themify')) . ' ' . __('Enable infinite scroll on single post view', 'themify') . '
';
return $output;
}
/**
* Options get metabox
* @since 1.0.0
* @var array
*/
if (!function_exists('themify_theme_get_post_metaboxes')) {
function themify_theme_get_post_metaboxes(array $args, &$meta_boxes) {
return array(
array(
'name' => __('Post Options', 'themify'),
'id' => 'post-options',
'options' => themify_theme_post_meta_box(),
'pages' => 'post'
),
);
}
}