'layout', 'title' => __('Sidebar Option', 'themify'), 'description' => '', 'type' => 'page_layout', 'show_title' => true, 'meta' => array( array('value' => 'default', 'img' => 'themify/img/default.svg', 'selected' => true, 'title' => __('Default', 'themify')), 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', 'title' => __('No Sidebar ', 'themify')), array('value' => 'full_width', 'img' => 'themify/img/fullwidth.svg', 'title' => __('Fullwidth (Builder Page)', 'themify')), ), 'default' => 'default', 'hide' => 'sidebar-none post_sticky_sidebar', ), array( 'name' => 'content_width', 'type' => 'hidden', ), array( 'name' => 'post_sticky_sidebar', 'title' => __('Sticky Sidebar', 'themify'), 'description' => '', 'type' => 'dropdown', 'show_title' => true, 'class' => 'hide-if sidebar-none', 'meta' => array( array('value' => '', 'name' => '', 'selected' => true), array('value' => 1, 'name' => __('Enable', 'themify')), array('value' => 0, 'name' => __('Disable', 'themify')) ), ), //Post Layout array( 'name' => 'post_layout', 'title' => __('Portfolio Layout', 'themify'), 'description' => '', 'type' => 'layout', 'show_title' => true, 'enable_toggle' => true, 'class' => 'hide-if none', 'meta' => array( array('value' => '', 'img' => 'themify/img/default.svg', 'selected' => true, 'title' => __('Default', 'themify')), array('value' => 'fullwidth', 'img' => 'images/layout-icons/post-fullwidth.png', 'title' => __('Fullwidth', 'themify')), array('value' => 'classic', 'img' => 'images/layout-icons/post-classic.png', 'title' => __('Classic', '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')) ), ), // Gallery Layout shortcode array( 'name' => 'post_layout_gallery', 'title' => '', 'description' => '', 'type' => 'gallery_shortcode', 'toggle' => 'gallery-toggle', 'class' => 'hide-if none', ), // Slider Layout shortcode array( 'name' => 'post_layout_slider', 'title' => '', 'description' => '', 'type' => 'gallery_shortcode', 'toggle' => 'slider-toggle', 'class' => 'hide-if none', ), // Featured Image Size array( 'name' => 'feature_size', 'title' => __('Image Size', 'themify'), 'description' => sprintf(__('Image sizes can be set at Media Settings and Regenerated', 'themify'), 'options-media.php', 'https://wordpress.org/plugins/regenerate-thumbnails/'), 'type' => 'featimgdropdown', 'display_callback' => 'themify_is_image_script_disabled' ), // Multi field: Image Dimension themify_image_dimensions_field(), // Hide Title array( 'name' => 'hide_post_title', 'title' => __('Post Title', 'themify'), 'description' => '', 'type' => 'dropdown', 'meta' => array( array('value' => 'default', 'name' => '', 'selected' => true), array('value' => 'yes', 'name' => __('Hide', 'themify')), array('value' => 'no', 'name' => __('Show', 'themify')) ), 'default' => 'default', ), // Unlink Post Title array( 'name' => 'unlink_post_title', 'title' => __('Post Title Link', 'themify'), 'type' => 'dropdown', 'meta' => array( array('value' => 'default', 'name' => '', 'selected' => true), array('value' => 'yes', 'name' => __('Unlinked', 'themify')), array('value' => 'no', 'name' => __('Linked', 'themify')) ), 'default' => 'default', ), // Hide Post Meta array( 'name' => 'hide_post_meta', 'title' => __('Post Meta', 'themify'), 'description' => '', 'type' => 'dropdown', 'meta' => array( array('value' => 'default', 'name' => '', 'selected' => true), array('value' => 'yes', 'name' => __('Hide', 'themify')), array('value' => 'no', 'name' => __('Show', 'themify')) ), 'default' => 'default', ), // Hide Post Image array( 'name' => 'hide_post_image', 'title' => __('Featured Image', 'themify'), 'description' => '', 'type' => 'dropdown', 'meta' => array( array('value' => 'default', 'name' => '', 'selected' => true), array('value' => 'yes', 'name' => __('Hide', 'themify')), array('value' => 'no', 'name' => __('Show', 'themify')) ), 'default' => 'default', ), // Unlink Post Image array( 'name' => 'unlink_post_image', 'title' => __('Featured Image Link', 'themify'), 'type' => 'dropdown', 'meta' => array( array('value' => 'default', 'name' => '', 'selected' => true), array('value' => 'yes', 'name' => __('Unlinked', 'themify')), array('value' => 'no', 'name' => __('Linked', 'themify')) ), 'default' => 'default', ), // External Link array( 'name' => 'external_link', 'title' => __('External Link', 'themify'), 'description' => __('Link Featured Image and Post Title to external URL', 'themify'), 'type' => 'textbox', 'meta' => array() ), // Lightbox Link themify_lightbox_link_field(), // Custom menu array( 'name' => 'custom_menu', 'title' => __('Custom Menu', 'themify'), 'description' => '', 'type' => 'dropdown', // extracted from $args 'meta' => themify_get_available_menus(), ), // Separator - Project Information array( 'name' => '_separator_project_info', 'title' => '', 'description' => '', 'type' => 'separator', 'meta' => array( 'html' => '
' . __('Portfolio Sidebar Option', 'themify') . '';
foreach ($sidebar_options as $option) {
if ((!isset($layout) || !$layout ) && ( isset($option['selected']) && $option['selected'] )) {
$layout = $option['value'];
}
if ($layout == $option['value']) {
$class = 'selected';
} else {
$class = '';
}
$output .= '';
}
$output .= '';
$output .= '
'; /** * Post Layout placement */ $output .= '
' . __('Portfolio Layout', 'themify') . '';
$val = themify_get($prefix . 'portfolio_layout_type');
foreach ($post_layout as $option) {
if (!$val && !empty($option['selected'])) {
$val = $option['value'];
}
if ($val == $option['value']) {
$class = 'selected';
} else {
$class = '';
}
$output .= '';
}
$output .= '
' . __('Portfolio Title', 'themify') . '
'; $output .= '' . __('Portfolio Title Link', 'themify') . '
'; // Hide Post Meta ///////////////////////////////////////// $output .= '' . __('Portfolio Meta', 'themify') . '
'; // Hide Portfolio Image ///////////////////////////////////////// $output .= '' . __('Portfolio Image', 'themify') . '
'; $output .= '' . __('Portfolio Image Link', 'themify') . '
'; /** * Image Dimensions */ $output .= '' . __('Image Size', 'themify') . ' ' . __('width', 'themify') . ' (px) ' . __('height', 'themify') . ' (px)
'; // Portfolio Navigation $prefix = 'setting-portfolio_nav_'; $output .= '' . __('Portfolio Navigation', 'themify') . '
'; $output .= '' . __('Portfolio Comments', 'themify') . '
'; return $output; } } if (!function_exists('themify_default_portfolio_index_layout')) { /** * Default Archive Portfolio Layout * @param array $data * @return string */ function themify_default_portfolio_index_layout($data = array()) { /** * Associative array containing theme settings * @var array */ $data = themify_get_data(); /** * Variable prefix key * @var string */ $prefix = 'setting-default_portfolio_index_'; /** * Basic default options '', 'yes', 'no' * @var array */ $default_options = array( array('name' => __('Show', 'themify'), 'value' => 'no'), array('name' => __('Hide', 'themify'), 'value' => 'yes'), ); /** * Default options 'yes', 'no' * @var array */ $binary_options = array( array('name' => __('Hide', 'themify'), 'value' => 'yes'), array('name' => __('Show', 'themify'), 'value' => 'no') ); $unlink_options = [ [ 'name' => __('Linked', 'themify'), 'value' => 'no' ], [ 'name' => __('Unlinked', 'themify'), 'value' => 'yes' ], ]; /** * Sidebar Layout * @var string */ $layout = isset($data[$prefix . 'layout']) ? $data[$prefix . 'layout'] : ''; /** * Sidebar Layout Options * @var array */ $sidebar_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')), ); /** * Post Layout Options * @var array */ $post_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'), 'selected' => true), 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' => 'auto_tiles', 'img' => 'images/layout-icons/auto-tiles.png', 'title' => __('Tiles', 'themify')) ); /** * HTML for settings panel * @var string */ $output = '
' . __('Portfolio Sidebar Option', 'themify') . '';
foreach ($sidebar_options as $option) {
if (( '' == $layout || !$layout || !isset($layout) ) && ( isset($option['selected']) && $option['selected'] )) {
$layout = $option['value'];
}
if ($layout == $option['value']) {
$class = 'selected';
} else {
$class = '';
}
$output .= '';
}
$output .= '';
$output .= '
'; /** * Post Layout */ $output .= '
' . __('Portfolio Layout', 'themify') . '';
$val = isset($data[$prefix . 'post_layout']) ? $data[$prefix . 'post_layout'] : '';
foreach ($post_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 .= '
' . __('Post Content Layout', 'themify') . '
'; /** * Enable Post Filter */ $output .= '' . __('Post Filter', 'themify') . '
'; /** * Enable Masonry */ $output .= '' . __('Masonry Layout', 'themify') . '
'; $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') . '
'; /** * Display Content */ $output .= '' . __('Display Content', 'themify') . '
'; $output .= '' . __('Portfolio Title', 'themify') . '
'; $output .= '' . __('Portfolio Title', 'themify') . '
'; // Hide Post Meta ///////////////////////////////////////// $output .= '' . __('Portfolio Meta', 'themify') . '
'; // Hide Portfolio Image ///////////////////////////////////////// $output .= '' . __('Portfolio Image', 'themify') . '
'; $output .= '' . __('Portfolio Image Link', 'themify') . '
'; /** * Image Dimensions */ $output .= '' . __('Image Size', 'themify') . ' ' . __('width', 'themify') . ' (px) ' . __('height', 'themify') . ' (px)
'; return $output; } } if (!function_exists('themify_portfolio_slug')) { /** * Portfolio Slug * @param array $data * @return string */ function themify_portfolio_slug($data = array()) { $data = themify_get_data(); $portfolio_slug = isset($data['themify_portfolio_slug']) ? $data['themify_portfolio_slug'] : apply_filters('themify_portfolio_rewrite', 'project'); $output = '' . __('Portfolio Base Slug', 'themify') . '
'; $portfolio_category_slug = isset($data['themify_portfolio_category_slug']) ? $data['themify_portfolio_category_slug'] : apply_filters('themify_portfolio_category_rewrite', 'portfolio-category'); $output .= '' . __('Portfolio Category Slug', 'themify') .themify_help(sprintf(__('Use only lowercase letters, numbers, underscores and dashes. After changing this, go to permalinks and click "Save changes" to refresh them.', 'themify'), admin_url('options-permalink.php'))) . '
'; return $output; } } /** * Options get metabox * @since 1.0.0 * @var array */ if (!function_exists('themify_theme_get_portfolio_metaboxes')) { function themify_theme_get_portfolio_metaboxes(array $args, &$meta_boxes) { /* remove the "portfolio-options" metabox added by Portfolio module in Builder */ foreach ($meta_boxes as $i => $m) { if ($m['id'] === 'portfolio-options' && $m['pages'] === 'portfolio') { unset($meta_boxes[$i]); break; } } return array( array( 'name' => __('Portfolio Options', 'themify'), 'id' => 'portfolio-options', 'options' => themify_theme_portfolio_meta_box(), 'pages' => 'portfolio' ), ); } }