/** * Get class used to determine width of column in primary layout. * * @since 2.2.0 * * @param string $column Which column to retrieve class for * @return string $column_class The class to be used in grid system */ function themeblvd_get_column_class($column) { $column_class = ''; $sidebar_layouts = themeblvd_sidebar_layouts(); $current_sidebar_layout = themeblvd_config('sidebar_layout'); if (isset($sidebar_layouts[$current_sidebar_layout]['columns'][$column])) { $column_class = $sidebar_layouts[$current_sidebar_layout]['columns'][$column]; } return apply_filters('themeblvd_column_class', $column_class); }
/** * Get settings for the Post Options meta box. * * @since 2.0.0 * * @return $setup filterable options for metabox */ function setup_themeblvd_post_meta() { // If using image radio buttons, define a directory path $imagepath = get_template_directory_uri() . '/framework/admin/assets/images/'; // Generate sidebar layout options $sidebar_layouts = array('default' => $imagepath . 'layout-default_2x.png'); $layouts = themeblvd_sidebar_layouts(); foreach ($layouts as $layout) { $sidebar_layouts[$layout['id']] = $imagepath . 'layout-' . $layout['id'] . '_2x.png'; } $setup = array('config' => array('id' => 'tb_post_options', 'title' => __('Post Options', 'themeblvd'), 'page' => array('post'), 'context' => 'normal', 'priority' => 'high'), 'options' => array('tb_meta' => array('id' => '_tb_meta', 'name' => __('Meta Information (the single post)', 'themeblvd'), 'desc' => __('Select if you\'d like the meta information (date posted, author, etc) to show at the top of the post. If you\'re going for a portfolio-type setup, you may want to hide the meta info. This does not apply to when this post is listed in a post list or post grid format. This option only refers to this single post.', 'themeblvd'), 'std' => 'default', 'type' => 'radio', 'options' => array('default' => __('Use default post setting.', 'themeblvd'), 'show' => __('Show meta info.', 'themeblvd'), 'hide' => __('Hide meta info.', 'themeblvd'))), 'tb_comments' => array('id' => '_tb_comments', 'name' => __('Comments (the single post)', 'themeblvd'), 'desc' => __('Select if you\'d like to completely hide comments or not below the post. This does not apply to when this post is listed in a post list or post grid format. This option only refers to this single post.', 'themeblvd'), 'std' => 'default', 'type' => 'radio', 'options' => array('default' => __('Use default post setting.', 'themeblvd'), 'show' => __('Show comments.', 'themeblvd'), 'hide' => __('Hide comments.', 'themeblvd'))), 'tb_breadcrumbs' => array('id' => '_tb_breadcrumbs', 'name' => __('Breadcrumbs (the single post)', 'themeblvd'), 'desc' => __('Select whether you\'d like breadcrumbs to show on this post or not.', 'themeblvd'), 'std' => 'default', 'type' => 'radio', 'options' => array('default' => __('Use default setting.', 'themeblvd'), 'show' => __('Yes, show breadcrumbs.', 'themeblvd'), 'hide' => __('No, hide breadcrumbs.', 'themeblvd'))), 'tb_thumb' => array('id' => '_tb_thumb', 'name' => __('Featured Image Display (the single post)', 'themeblvd'), 'desc' => __('Select how you\'d like the featured image to show at the top of the post. This does <em>not</em> apply to when this post is listed in a post list or post grid. This option only refers to this single post.', 'themeblvd'), 'std' => 'default', 'type' => 'radio', 'options' => array('default' => __('Use default post setting.', 'themeblvd'), 'small' => __('Show small thumbnail.', 'themeblvd'), 'full' => __('Show full-width thumbnail.', 'themeblvd'), 'hide' => __('Hide featured image.', 'themeblvd'))), 'tb_thumb_link' => array('id' => '_tb_thumb_link', 'name' => __('Featured Image Link (everywhere)', 'themeblvd'), 'desc' => __('Here you can select how you\'d like this post\'s featured image to react when clicked. This <em>does</em> apply to both this single post page and when this post is used in a post list or post grid.', 'themeblvd'), 'type' => 'radio', 'std' => 'inactive', 'class' => 'select-tb-thumb-link', 'options' => array('inactive' => __('Featured image is not a link.', 'themeblvd'), 'post' => __('It links to its post.', 'themeblvd'), 'thumbnail' => __('It links to its enlarged lightbox version.', 'themeblvd'), 'image' => __('It links to a custom lightbox image.', 'themeblvd'), 'video' => __('It links to a lightbox video.', 'themeblvd'), 'external' => __('It links to a webpage.', 'themeblvd'))), 'tb_image_link' => array('id' => '_tb_image_link', 'name' => __('Featured Image - Image Link', 'themeblvd'), 'desc' => __('Enter the full URL of enlarged image that the featured image will link to.<br><br>Ex: http://your-site.com/uploads/image.jpg', 'themeblvd'), 'class' => 'tb-thumb-link tb-thumb-link-image', 'type' => 'text'), 'tb_video_link' => array('id' => '_tb_video_link', 'name' => __('Featured Image - Video Link', 'themeblvd'), 'desc' => __('Enter the full URL to a video page supported by <a href="http://codex.wordpress.org/Embeds" target="_blank">WordPress\'s oEmbed</a>.<br><br>Ex: http://www.youtube.com/watch?v=ginTCwWfGNY<br>Ex: http://vimeo.com/11178250', 'themeblvd'), 'class' => 'tb-thumb-link tb-thumb-link-video', 'type' => 'text'), 'tb_external_link' => array('id' => '_tb_external_link', 'name' => __('Featured Image - External Link', 'themeblvd'), 'desc' => __('Enter the full URL of where the featured image will link.<br><br>Ex: http://google.com', 'themeblvd'), 'class' => 'tb-thumb-link tb-thumb-link-external', 'type' => 'text'), 'tb_external_link_target' => array('id' => '_tb_external_link_target', 'name' => __('Featured Image - External Link Target', 'themeblvd'), 'desc' => __('Select whether you\'d like the external link to open in a new window or not.', 'themeblvd'), 'class' => 'tb-thumb-link tb-thumb-link-external', 'type' => 'radio', 'std' => '_blank', 'options' => array('_blank' => __('Open link in new window.', 'themeblvd'), '_self' => __('Open link in same window.', 'themeblvd'))), 'tb_thumb_link_single' => array('id' => '_tb_thumb_link_single', 'name' => __('Featured Image Link (the single post)', 'themeblvd'), 'desc' => __('If you\'ve selected a featured image link above, select whether you\'d like the image link to be applied to the featured image on the single post page or not.', 'themeblvd'), 'class' => 'tb-thumb-link tb-thumb-link-single', 'std' => 'yes', 'type' => 'radio', 'options' => array('yes' => __('Yes, apply featured image link to single post.', 'themeblvd'), 'no' => __('No, don\'t apply featured image link to single post.', 'themeblvd'))), 'tb_sidebar_layout' => array('id' => '_tb_sidebar_layout', 'name' => __('Sidebar Layout', 'themeblvd'), 'desc' => __('Choose the sidebar layout for this specific post. Keeping it set to "Website Default" will allow this post to continue using the sidebar layout selected on the Theme Options page.', 'themeblvd'), 'std' => 'default', 'type' => 'images', 'options' => $sidebar_layouts, 'img_width' => '65'))); return apply_filters('themeblvd_post_meta', $setup); }
/** * Setup raw options array for the start of the * API process. * * Note: The framework used to reference these as * "core options" before this class existed. * * @since 2.3.0 * * Layout * - Header * - logo * - Main * - breadcrumbs * - sidebar_layout * - Footer * - start_footer_cols * - footer_setup * - footer_col_1 * - footer_col_2 * - footer_col_3 * - footer_col_4 * - footer_col_5 * - end_footer_cols * - footer_copyright * Content * - Single Posts * - single_meta * - single_thumbs * - single_comments * - Primary Posts Display * - blog_thumbs * - blog_content * - blog_categories * - start_featured * - blog_featured * - blog_slider * - end_featured * - Archives * - archive_title * - archive_thumbs * - archive_content * - Lightbox * - lightbox_animation * - lightbox_mobile * - lightbox_mobile_iframe * - lightbox_mobile_gallery */ private function set_raw_options() { /*--------------------------------*/ /* Option helpers /*--------------------------------*/ // If using image radio buttons, define a directory path $imagepath = get_template_directory_uri() . '/framework/admin/assets/images/'; // Generate sidebar layout options $sidebar_layouts = array(); if (is_admin()) { $layouts = themeblvd_sidebar_layouts(); foreach ($layouts as $layout) { $sidebar_layouts[$layout['id']] = $imagepath . 'layout-' . $layout['id'] . '_2x.png'; } } // Pull all the categories into an array $options_categories = array(); if (is_admin()) { $options_categories_obj = get_categories(array('hide_empty' => false)); foreach ($options_categories_obj as $category) { $options_categories[$category->cat_ID] = $category->cat_name; } } /*--------------------------------*/ /* Tab #1: Layout /*--------------------------------*/ $layout_options = array('header' => array('name' => __('Header', 'themeblvd'), 'options' => array('logo' => array('name' => __('Logo', 'themeblvd'), 'desc' => __('Configure the primary branding logo for the header of your site.<br /><br />Use the "Upload" button to either upload an image or select an image from your media library. When inserting an image with the "Upload" button, the URL and width will be inserted for you automatically. You can also type in the URL to an image in the text field along with a manually-entered width.<br /><br />If you\'re inputting a "HiDPI-optimized" image, it needs to be twice as large as you intend it to be displayed. Feel free to leave the HiDPI image field blank if you\'d like it to simply not have any effect.', 'themeblvd'), 'id' => 'logo', 'std' => array('type' => 'image', 'image' => get_template_directory_uri() . '/assets/images/logo.png', 'image_width' => '220', 'image_2x' => get_template_directory_uri() . '/assets/images/logo_2x.png'), 'type' => 'logo'))), 'main' => array('name' => __('Main', 'themeblvd'), 'options' => array('breadcrumbs' => array('name' => __('Breadcrumbs', 'themeblvd'), 'desc' => __('Select whether you\'d like breadcrumbs to show throughout the site or not.', 'themeblvd'), 'id' => 'breadcrumbs', 'std' => 'show', 'type' => 'select', 'options' => array('show' => __('Yes, show breadcrumbs.', 'themeblvd'), 'hide' => __('No, hide breadcrumbs.', 'themeblvd'))), 'sidebar_layout' => array('name' => __('Default Sidebar Layout', 'themeblvd'), 'desc' => __('Choose the default sidebar layout for the main content area of your site.<br><br><em>Note: This will be the default sidebar layout throughout your site, but you can be override this setting for any specific page or custom layout.</em>', 'themeblvd'), 'id' => 'sidebar_layout', 'std' => 'sidebar_right', 'type' => 'images', 'options' => $sidebar_layouts, 'img_width' => '65'))), 'footer' => array('name' => __('Footer', 'themeblvd'), 'options' => array('start_footer_cols' => array('type' => 'subgroup_start', 'class' => 'columns'), 'footer_setup' => array('name' => __('Setup Columns', 'themeblvd'), 'desc' => __('Choose the number of columns along with the corresponding width configurations.', 'themeblvd'), 'id' => 'footer_setup', 'type' => 'columns', 'options' => 'standard'), 'footer_col_1' => array('name' => __('Footer Column #1', 'themeblvd'), 'desc' => __('Configure the content for the first column.', 'themeblvd'), 'id' => 'footer_col_1', 'type' => 'content', 'class' => 'col_1', 'options' => array('widget', 'page', 'raw')), 'footer_col_2' => array('name' => __('Footer Column #2', 'themeblvd'), 'desc' => __('Configure the content for the second column.', 'themeblvd'), 'id' => 'footer_col_2', 'type' => 'content', 'class' => 'col_2', 'options' => array('widget', 'page', 'raw')), 'footer_col_3' => array('name' => __('Footer Column #3', 'themeblvd'), 'desc' => __('Configure the content for the third column.', 'themeblvd'), 'id' => 'footer_col_3', 'type' => 'content', 'class' => 'col_3', 'options' => array('widget', 'page', 'raw')), 'footer_col_4' => array('name' => __('Footer Column #4', 'themeblvd'), 'desc' => __('Configure the content for the fourth column.', 'themeblvd'), 'id' => 'footer_col_4', 'type' => 'content', 'class' => 'col_4', 'options' => array('widget', 'page', 'raw')), 'footer_col_5' => array('name' => __('Footer Column #5', 'themeblvd'), 'desc' => __('Configure the content for the fifth column.', 'themeblvd'), 'id' => 'footer_col_5', 'type' => 'content', 'class' => 'col_5', 'options' => array('widget', 'page', 'raw')), 'end_footer_cols' => array('type' => 'subgroup_end'), 'footer_copyright' => array('name' => __('Footer Copyright Text', 'themeblvd'), 'desc' => __('Enter the copyright text you\'d like to show in the footer of your site.', 'themeblvd'), 'id' => 'footer_copyright', 'std' => '(c) ' . date('Y') . ' ' . get_bloginfo('site_title') . ' - Powered by <a href="http://wordpress.org" title="WordPress" target="_blank">WordPress</a>, Designed by <a href="http://themeblvd.com" title="Theme Blvd" target="_blank">Theme Blvd</a>', 'type' => 'text')))); /*--------------------------------*/ /* Tab #2: Content /*--------------------------------*/ $content_options = array('single' => array('name' => __('Single Posts', 'themeblvd'), 'desc' => __('These settings will only apply to vewing single posts. This means that any settings you set here will <strong>not</strong> effect any posts that appear in a post list or post grid.', 'themeblvd'), 'options' => array('single_meta' => array('name' => __('Show meta information at top of posts?', 'themeblvd'), 'desc' => __('Select if you\'d like the meta information (date posted, author, etc) to show at the top of the post. If you\'re going for a portfolio-type setup, you may want to hide the meta info.', 'themeblvd'), 'id' => 'single_meta', 'std' => 'show', 'type' => 'radio', 'options' => array('show' => __('Show meta info.', 'themeblvd'), 'hide' => __('Hide meta info.', 'themeblvd'))), 'single_thumbs' => array('name' => __('Show featured images at top of posts?', 'themeblvd'), 'desc' => __('Choose how you want your featured images to show at the top of the posts. It can be useful to turn this off if you want to have featured images over on your blogroll or post grid sections, but you don\'t want them to show on the actual posts themeselves.', 'themeblvd'), 'id' => 'single_thumbs', 'std' => 'small', 'type' => 'radio', 'options' => array('small' => __('Show small thumbnails.', 'themeblvd'), 'full' => __('Show full-width thumbnails.', 'themeblvd'), 'hide' => __('Hide thumbnails.', 'themeblvd'))), 'single_comments' => array('name' => __('Show comments below posts?', 'themeblvd'), 'desc' => __('Select if you\'d like to completely hide comments or not below the post.', 'themeblvd'), 'id' => 'single_comments', 'std' => 'show', 'type' => 'radio', 'options' => array('show' => __('Show comments.', 'themeblvd'), 'hide' => __('Hide comments.', 'themeblvd'))))), 'blog' => array('name' => __('Primary Posts Display', 'themeblvd'), 'desc' => __('These settings apply to your primary posts page that you\'ve selected under Settings > Reading and <strong>all</strong> instances of the "Post List" page template. Note that if you want to use the post list page template for multiple pages with different categories on each, you can accomplish this on each specific page with custom fields - <a href="http://vimeo.com/32754998">Learn More</a>.', 'themeblvd'), 'options' => array('blog_thumbs' => array('name' => __('Featured Images', 'themeblvd'), 'desc' => __('Select the size of the blog\'s post thumbnail or whether you\'d like to hide them all together when posts are listed.', 'themeblvd'), 'id' => 'blog_thumbs', 'std' => 'small', 'type' => 'radio', 'options' => array('small' => __('Show small thumbnails.', 'themeblvd'), 'full' => __('Show full-width thumbnails.', 'themeblvd'), 'hide' => __('Hide thumbnails.', 'themeblvd'))), 'blog_content' => array('name' => __('Show excerpts or full content?', 'themeblvd'), 'desc' => __('Choose whether you want to show full content or post excerpts only.', 'themeblvd'), 'id' => 'blog_content', 'std' => 'content', 'type' => 'radio', 'options' => array('content' => __('Show full content.', 'themeblvd'), 'excerpt' => __('Show excerpt only.', 'themeblvd'))), 'blog_categories' => array('name' => __('Exclude Categories', 'themeblvd'), 'desc' => __('Select any categories you\'d like to be excluded from your blog.', 'themeblvd'), 'id' => 'blog_categories', 'type' => 'multicheck', 'options' => $options_categories))), 'archives' => array('name' => __('Archives', 'themeblvd'), 'desc' => __('These settings apply any time you\'re viewing search results or posts specific to a category, tag, date, author, etc.', 'themeblvd'), 'options' => array('archive_title' => array('name' => __('Show title on archive pages?', 'themeblvd'), 'desc' => __('Choose whether or not you want the title to show on tag archives, category archives, date archives, author archives and search result pages.', 'themeblvd'), 'id' => 'archive_title', 'std' => 'false', 'type' => 'radio', 'options' => array('true' => __('Yes, show main title at the top of archive pages.', 'themeblvd'), 'false' => __('No, hide the title.', 'themeblvd'))), 'archive_thumbs' => array('name' => __('Show featured images on archive pages?', 'themeblvd'), 'desc' => __('Choose whether or not you want featured images to show on tag archives, category archives, date archives, author archives and search result pages.', 'themeblvd'), 'id' => 'archive_thumbs', 'std' => 'small', 'type' => 'radio', 'options' => array('small' => __('Show small thumbnails.', 'themeblvd'), 'full' => __('Show full-width thumbnails.', 'themeblvd'), 'hide' => __('Hide thumbnails.', 'themeblvd'))), 'archive_content' => array('name' => __('Show excerpts or full content?', 'themeblvd'), 'desc' => __('Choose whether you want to show full content or post excerpts only.', 'themeblvd'), 'id' => 'archive_content', 'std' => 'excerpt', 'type' => 'radio', 'options' => array('content' => __('Show full content.', 'themeblvd'), 'excerpt' => __('Show excerpt only.', 'themeblvd'))))), 'lightbox' => array('name' => __('Lightbox', 'themeblvd'), 'desc' => __('These settings apply to the built-in lightbox functionality, which utilizes the <a href="http://dimsemenov.com/plugins/magnific-popup/" target="_blank">Magnific Popup</a> script.', 'themeblvd'), 'options' => array('lightbox_animation' => array('name' => __('Animate lightboxes?', 'themeblvd'), 'desc' => __('Select if you\'d like lightboxes to animate as they open and close.', 'themeblvd'), 'id' => 'lightbox_animation', 'std' => 'fade', 'type' => 'radio', 'options' => array('none' => __('No animation', 'themeblvd'), 'fade' => __('Fade animation', 'themeblvd'))), 'lightbox_mobile' => array('name' => __('Disable standard lightboxes for mobile?', 'themeblvd'), 'desc' => __('Select if you\'d like the lightbox to be disabled for mobile users viewing a standard lightbox instance.', 'themeblvd'), 'id' => 'lightbox_mobile', 'std' => 'no', 'type' => 'radio', 'options' => array('yes' => __('Yes, disable for mobile.', 'themeblvd'), 'no' => __('No, do not disable for mobile.', 'themeblvd'))), 'lightbox_mobile_iframe' => array('name' => __('Disable iframe lightboxes for mobile?', 'themeblvd'), 'desc' => __('Select if you\'d like the lightbox to be disabled for mobile users viewing an iframe lightbox instance. This includes linking to YouTube videos, Vimeo videos, and Google Maps in a lightbox popup.', 'themeblvd'), 'id' => 'lightbox_mobile_iframe', 'std' => 'yes', 'type' => 'radio', 'options' => array('yes' => __('Yes, disable for mobile.', 'themeblvd'), 'no' => __('No, do not disable for mobile.', 'themeblvd'))), 'lightbox_mobile_gallery' => array('name' => __('Disable gallery lightboxes for mobile?', 'themeblvd'), 'desc' => __('Select if you\'d like the lightbox to be disabled for mobile users when viewing a gallery.', 'themeblvd'), 'id' => 'lightbox_mobile_gallery', 'std' => 'no', 'type' => 'radio', 'options' => array('yes' => __('Yes, disable for mobile.', 'themeblvd'), 'no' => __('No, do not disable for mobile.', 'themeblvd')))))); /*--------------------------------*/ /* Finalize and extend /*--------------------------------*/ $this->raw_options = array('layout' => array('name' => __('Layout', 'themeblvd'), 'sections' => $layout_options), 'content' => array('name' => __('Content', 'themeblvd'), 'sections' => $content_options)); // The following filter probably won't be used often, // but if there's something that can't be accomplished // through the client mutator API methods, then this // provides a way to modify these raw options. $this->raw_options = apply_filters('themeblvd_core_options', $this->raw_options); }
/** * Generates the the interface to edit the layout * when in the metabox interface of editing Pages. * * @since 1.1.0 * * @param $id string ID of layout to edit */ public function mini_edit_layout($id) { $api = Theme_Blvd_Builder_API::get_instance(); // If no layout (i.e. User selected "none" or one hasn't been chosen yet) if (!$id) { echo '<p class="warning">' . __('Select a layout to apply and edit it, or create a new one.', 'themeblvd_builder') . '</p>'; return; } // Get custom layout post $elements = $this->get_elements(); $layout = get_post($id); // Check if valid layout if (!$layout) { echo '<p class="warning">' . __('The layout currently selected no longer exists. Select a different layout to edit, or create a new one.', 'themeblvd_builder') . '</p>'; return; } // Grab elements and settings for the layout we're editing $layout_elements = get_post_meta($id, 'elements', true); $layout_settings = get_post_meta($id, 'settings', true); ?> <input type="hidden" name="tb_layout_id" value="<?php echo $id; ?> " /> <h3><?php _e('Edit Layout', 'themeblvd_builder'); ?> : <?php echo $layout->post_title; ?> </h3> <div id="metabox-builder"> <div class="edit-layout-wrap"> <div id="titlediv"> <div class="ajax-overlay"></div> <h2><?php _e('Manage Elements', 'themeblvd_builder'); ?> </h2> <select> <?php foreach ($elements as $element) { echo '<option value="' . $element['info']['id'] . '=>' . $element['info']['query'] . '">' . $element['info']['name'] . '</option>'; } ?> </select> <a href="#" id="add_new_element" class="button-secondary"><?php _e('Add New Element', 'themeblvd_builder'); ?> </a> <span class="tb-loader ajax-loading"></span> <div class="clear"></div> </div><!-- #titlediv (end) --> <div id="builder"> <div id="featured"> <span class="label"><?php _e('Featured Above', 'themeblvd_builder'); ?> </span> <div class="sortable"> <?php if (!empty($layout_elements) && !empty($layout_elements['featured'])) { foreach ($layout_elements['featured'] as $id => $element) { if ($api->is_element($element['type'])) { $this->edit_element($element['type'], $id, $element['options']); } } } ?> </div><!-- .sortable (end) --> </div><!-- #featured (end) --> <div id="primary"> <input type="hidden" name="tb_elements[divider]" value="" /> <span class="label"><?php _e('Primary Area', 'themeblvd_builder'); ?> </span> <div class="sortable"> <?php if (!empty($layout_elements) && !empty($layout_elements['primary'])) { foreach ($layout_elements['primary'] as $id => $element) { if ($api->is_element($element['type'])) { $this->edit_element($element['type'], $id, $element['options']); } } } ?> </div><!-- .sortable (end) --> </div><!-- #primary (end) --> <div id="featured_below"> <input type="hidden" name="tb_elements[divider_2]" value="" /> <span class="label"><?php _e('Featured Below', 'themeblvd_builder'); ?> </span> <div class="sortable"> <?php if (!empty($layout_elements) && !empty($layout_elements['featured_below'])) { foreach ($layout_elements['featured_below'] as $id => $element) { if ($api->is_element($element['type'])) { $this->edit_element($element['type'], $id, $element['options']); } } } ?> </div><!-- .sortable (end) --> </div><!-- #primary (end) --> </div><!-- #builder (end) --> </div><!-- .edit-layout-wrap (end) --> <div class="sidebar-layout-wrap"> <div class="title"> <h2><?php _e('Sidebar Layout', 'themeblvd_builder'); ?> </h2> <div class="clear"></div> </div><!-- #titlediv (end) --> <div class="sidebar-layout"> <?php // Setup sidebar layouts $imagepath = get_template_directory_uri() . '/framework/admin/assets/images/'; $sidebar_layouts = array('default' => $imagepath . 'layout-default.png'); $layouts = themeblvd_sidebar_layouts(); foreach ($layouts as $layout) { $sidebar_layouts[$layout['id']] = $imagepath . 'layout-' . $layout['id'] . '.png'; } // Now convert it to options form $options = array(array('id' => 'sidebar_layout', 'desc' => __('Select how you\'d like the sidebar(s) arranged in this layout. Your site-wide default sidebar layout can be set from your Theme Options page.<br><br><strong>Note: The sidebar layout is only applied to the "Primary Area" of the custom layout.</strong>', 'themeblvd_builder'), 'type' => 'images', 'options' => $sidebar_layouts)); // Display form element $form = themeblvd_option_fields('tb_layout_options', $options, $layout_settings, false); echo $form[0]; ?> </div> </div><!-- .sidebar-layout-wrap (end) --> <div class="custom-layout-note"> <p><?php _e('Note: For this custom layout to be applied to the current page, you must select the "Custom Layout" page template from your Page Attributes.', 'themeblvd_builder'); ?> </p> </div> </div><!-- #metabox-builder (end) --> <?php }
/** * Option for selecting a sidebar layout that gets * inserted into out Hi-jacked "Page Attributes" * meta box. * * @since 2.0.0 * * @param $layout string current sidebar layout * @param $output string HTML to output */ function themeblvd_sidebar_layout_dropdown($layout = null) { $sidebar_layouts = themeblvd_sidebar_layouts(); $output = '<p><strong>' . __('Sidebar Layout', 'themeblvd') . '</strong></p>'; $output .= '<select name="_tb_sidebar_layout">'; $output .= '<option value="default">' . __('Default Sidebar Layout', 'themeblvd') . '</option>'; foreach ($sidebar_layouts as $sidebar_layout) { $output .= sprintf('<option value="%s" %s>%s</option>', $sidebar_layout['id'], selected($sidebar_layout['id'], $layout, false), $sidebar_layout['name']); } $output .= '</select>'; return $output; }