Example #1
0
 /**
  * Constructor - Initializes
  */
 public function __construct()
 {
     parent::__construct('calibrefx-settings');
     $this->page_id = 'calibrefx';
     $this->default_settings = apply_filters('calibrefx_theme_settings_defaults', array('update' => 1, 'blog_title' => 'text', 'header_right' => 0, 'layout_type' => 'static', 'calibrefx_layout_width' => 1160, 'calibrefx_layout_wrapper_fixed' => 0, 'site_layout' => calibrefx_get_default_layout(), 'sidebar_width' => 4, 'feature_image_layout' => 'full', 'nav' => 1, 'subnav' => 0, 'post_date' => 1, 'post_author' => 1, 'post_comment' => 1, 'post_category' => 1, 'post_tags' => 1, 'breadcrumb_home' => 1, 'breadcrumb_single' => 1, 'breadcrumb_page' => 1, 'breadcrumb_archive' => 1, 'breadcrumb_404' => 1, 'comments_pages' => 0, 'comments_posts' => 1, 'trackbacks_pages' => 0, 'trackbacks_posts' => 1, 'custom_css' => '', 'content_archive' => 'full', 'content_archive_limit' => 0, 'posts_nav' => 'older-newer', 'header_scripts' => '', 'footer_scripts' => '', 'enable_mobile' => 0, 'log_threshold' => 4, 'log_date_format' => 'Y-m-d H:i:s', 'log_path' => '', 'calibrefx_version' => FRAMEWORK_VERSION, 'calibrefx_db_version' => FRAMEWORK_DB_VERSION));
     //Initializing hooks
     $this->initialize();
     if (current_user_can('edit_theme_options')) {
         add_action('admin_init', array($this, 'manage_modules'));
         add_action('admin_init', array($this, 'handle_export_import'));
     }
 }
Example #2
0
/**
 * This function will get the custom layout from the specific post
 * if none, then will return default layout
 *
 * @param void
 * @return string
 */
function calibrefx_site_layout()
{
    global $post;
    $site_layout = calibrefx_get_option('site_layout');
    // Use default layout as a fallback, if necessary
    if (!calibrefx_get_layout($site_layout)) {
        $site_layout = calibrefx_get_default_layout();
    }
    $front_content = get_option('show_on_front');
    $custom_layout = false;
    if (is_single() or is_page()) {
        $custom_layout = get_post_meta($post->ID, '_calibrefx_layout', true);
    }
    if ($custom_layout) {
        return esc_attr(apply_filters('calibrefx_site_layout', $custom_layout));
    }
    return esc_attr(apply_filters('calibrefx_site_layout', $site_layout));
}