示例#1
0
/**
 * Show inpost layout box
 */
function calibrefx_inpost_layout_box()
{
    wp_nonce_field('calibrefx_inpost_layout_action', 'calibrefx_inpost_layout_nonce');
    $layout = calibrefx_get_custom_field('site_layout');
    ?>
    <div class="calibrefx-layout-selector">
        <p>
        	<input type="radio" name="_calibrefx_layout" id="default-layout" value="" <?php 
    checked($layout, '');
    ?>
 /> <label class="default" for="default-layout"><?php 
    printf(__('Default Layout set in <a href="%s">Theme Settings</a>', 'calibrefx'), menu_page_url('calibrefx', 0));
    ?>
</label>
        </p>
        <?php 
    calibrefx_layout_selector(array('name' => '_calibrefx_layout', 'selected' => $layout, 'type' => 'site'));
    ?>
    </div>

    <br class="clear" />

    <p><label for="calibrefx_custom_body_class"><b><?php 
    _e('Custom Body Class', 'calibrefx');
    ?>
</b></label></p>
    <p><label for="calibrefx_custom_post_class"><b><?php 
    _e('Custom Post Class', 'calibrefx');
    ?>
</b></label></p>
    <p><input class="large-text" type="text" name="_calibrefx_custom_post_class" id="calibrefx_custom_post_class" value="<?php 
    echo esc_attr(sanitize_html_class(calibrefx_get_custom_field('_calibrefx_custom_post_class')));
    ?>
" /></p>
    <?php 
}
示例#2
0
 /**
  * Show default layout box
  */
 function layout_box()
 {
     global $calibrefx;
     calibrefx_add_meta_group('layout-settings', 'layout-general-settings', __('Layout Settings', 'calibrefx'));
     calibrefx_add_meta_group('layout-settings', 'layout-type-settings', __('General Layout Settings', 'calibrefx'));
     calibrefx_add_meta_group('layout-settings', 'feature-image-settings', __('Feature Image Settings', 'calibrefx'));
     //For Layout Settings
     add_action('layout-settings_options', function () {
         calibrefx_add_meta_option('layout-general-settings', 'layout_type', __('How would you like the main layout of the website?', 'calibrefx'), array('option_type' => 'select', 'option_items' => apply_filters('calibrefx_layout_type_options', array('static' => __('Fix Width Layout', 'calibrefx'), 'fluid' => __('Fluid Layout', 'calibrefx'))), 'option_default' => 'static', 'option_filter' => 'safe_text'), 1);
         calibrefx_add_meta_option('layout-general-settings', 'calibrefx_layout_width', __('Layout Width (pixels)', 'calibrefx'), array('option_type' => 'textinput', 'option_default' => '940', 'option_filter' => 'integer', 'option_attr' => array('class' => 'calibrefx_layout_width')), 5);
         calibrefx_add_meta_option('layout-general-settings', 'calibrefx_layout_wrapper_fixed', __('Use Wrapper Border Box', 'calibrefx'), array('option_type' => 'checkbox', 'option_items' => '1', 'option_default' => '', 'option_filter' => 'integer', 'option_description' => __('Check this if you want to have wrapper box layout.', 'calibrefx'), 'option_attr' => array('class' => 'calibrefx_layout_width')), 6);
         calibrefx_add_meta_option('layout-general-settings', 'responsive_disabled', __('Check this to disable responsive', 'calibrefx'), array('option_type' => 'checkbox', 'option_items' => '1', 'option_default' => '0', 'option_filter' => 'integer', 'option_description' => __('Check this if you want to disable mobile responsive feature', 'calibrefx')), 15);
     });
     //For General Layout Settings
     add_action('layout-settings_options', function () {
         calibrefx_add_meta_option('layout-type-settings', 'site_layout', __('Pick your general layout column', 'calibrefx'), array('option_type' => 'custom', 'option_custom' => calibrefx_layout_selector(array('name' => 'calibrefx-settings[site_layout]', 'selected' => calibrefx_get_option('site_layout'), 'echo' => false)), 'option_default' => '', 'option_filter' => '', 'option_attr' => array('class' => 'calibrefx-layout-selector'), 'option_description' => __('You can choose your Website layout. You can override per post / page later.', 'calibrefx')), 1);
         calibrefx_add_meta_option('layout-type-settings', 'sidebar_width', __('Customize Your Sidebar Width', 'calibrefx'), array('option_type' => 'select', 'option_items' => array('2' => __('2/12 of total columns', 'calibrefx'), '3' => __('3/12 of total columns', 'calibrefx'), '4' => __('4/12 of total columns', 'calibrefx'), '5' => __('5/12 of total columns', 'calibrefx'), '6' => __('6/12 of total columns', 'calibrefx')), 'option_default' => '4', 'option_attr' => array('class' => 'calibrefx-sidebar-width'), 'option_filter' => 'safe_text'), 1);
     });
     //For Feature Image Layout Settings
     add_action('layout-settings_options', function () {
         calibrefx_add_meta_option('feature-image-settings', 'feature_image_layout', __('How do you want to show the feature image?', 'calibrefx'), array('option_type' => 'select', 'option_items' => apply_filters('calibrefx_layout_type_options', array('thumbnail' => __('Square Thumbnail', 'calibrefx'), 'full' => __('Full Width', 'calibrefx'), 'none' => __('None', 'calibrefx'))), 'option_default' => 'full', 'option_filter' => 'safe_text'), 1);
     });
     calibrefx_do_meta_options($calibrefx->theme_settings, 'layout-settings');
 }