<?php global $fable_parentPost; $Page = new ThemePage(); $Validation = new ThemeValidation(); $WidgetArea = new ThemeWidgetArea(); $widgetAreaData = $WidgetArea->getWidgetAreaByPost($fable_parentPost->post, true, true); $class = $WidgetArea->getWidgetAreaCSSClass($widgetAreaData); $template = $Page->getCurrentTemplate(); $widgetAreaFooterEnable = false; if (ThemeOption::getOption('footer_top_enable') == 1) { $widgetAreaData = $WidgetArea->getWidgetAreaByPost($fable_parentPost->post, false, true); $layout = $WidgetArea->setWidgetAreaLayout($widgetAreaData['id']); if ($widgetAreaData['id'] && $widgetAreaData['location']) { $widgetAreaFooterEnable = true; } } if (ThemeOption::getOption('footer_enable') == 1 && ($widgetAreaFooterEnable || ThemeOption::getGlobalOption($post, 'footer_bottom_enable') == 1)) { ?> <div class="theme-footer theme-clear-fix"> <?php if ($widgetAreaFooterEnable) { $style = array(); if ($Validation->isNotEmpty(ThemeOption::getOption('footer_top_background_image_src'))) { $style['background-image'] = 'url(\'' . ThemeOption::getOption('footer_top_background_image_src') . '\')'; $style['background-repeat'] = ThemeOption::getOption('footer_top_background_image_repeat'); if ($Validation->isNotEmpty(ThemeOption::getOption('footer_top_background_image_position'))) { $style['background-position'] = ThemeOption::getOption('footer_top_background_image_position'); } $style['background-size'] = ThemeOption::getOption('footer_top_background_image_size_1'); if (in_array($style['background-size'], array('length', 'percentage'))) {
<?php global $post, $fable_parentPost; $Blog = new ThemeBlog(); $Page = new ThemePage(); $Post = new ThemePost(); $Validation = new ThemeValidation(); $WidgetArea = new ThemeWidgetArea(); $widgetAreaData = $WidgetArea->getWidgetAreaByPost($fable_parentPost->post, true, true); $query = $Blog->getPost(); $postCount = count($query->posts); if ($postCount) { ?> <div class="theme-clear-fix"> <ul class="theme-reset-list theme-clear-fix theme-blog"> <?php while ($query->have_posts()) { $query->the_post(); $excerpt = apply_filters('the_content', get_the_excerpt()); $option = ThemeOption::getPostMeta($post); ThemeHelper::removeUIndex($option, 'post_type'); $visibleOption = array(); $visibleOption['post_tag_visible'] = ThemeOption::getGlobalOption($post, 'post_tag_visible'); $visibleOption['post_author_visible'] = ThemeOption::getGlobalOption($post, 'post_author_visible'); $visibleOption['post_category_visible'] = ThemeOption::getGlobalOption($post, 'post_category_visible'); $visibleOption['post_comment_count_visible'] = ThemeOption::getGlobalOption($post, 'post_comment_count_visible') && comments_open(get_the_id()); ?> <li id="post-<?php the_ID(); ?>
function setupTheme() { global $content_width; if (!isset($content_width)) { $content_width = 1050; } /***/ $Menu = new ThemeMenu(); $Post = new ThemePost(); $Page = new ThemePage(); $Image = new ThemeImage(); $Comment = new ThemeComment(); $WidgetArea = new ThemeWidgetArea(); $MaintenanceMode = new ThemeMaintenanceMode(); $WidgetPostRecent = new ThemeWidgetPostRecent(); $WidgetPostMostComment = new ThemeWidgetPostMostComment(); /***/ $Image->register(); $WidgetArea->register(); /***/ add_theme_support('menus'); add_theme_support('post-thumbnails'); add_theme_support('automatic-feed-links'); /***/ if (function_exists('register_nav_menu')) { register_nav_menu('menu_top', 'Menu Top'); } /***/ add_filter('widget_text', 'do_shortcode'); add_filter('wp_title', array($Page, 'displayTitle')); add_filter('image_size_names_choose', array($Image, 'addImageSupport')); add_filter('excerpt_more', array($this, 'filterExcerptMore')); add_filter('excerpt_length', array($this, 'automaticExcerptLength'), 999); /***/ add_editor_style('editor-style.css'); /***/ if (!class_exists('PBComponentMenu')) { add_filter('wp_setup_nav_menu_item', array($Menu, 'setupNavigationMenuItemField')); add_action('wp_update_nav_menu_item', array($Menu, 'updateNavigationMenuItemField'), 10, 3); add_filter('wp_edit_nav_menu_walker', array($Menu, 'editNavigationMenuWalker'), 10, 2); } /***/ add_action('save_post', array($this, 'adminSaveMetaBox')); add_action('add_meta_boxes', array($Page, 'adminInitMetaBox')); add_action('add_meta_boxes', array($Post, 'adminInitMetaBox')); add_action('add_meta_boxes', array($this, 'adminInitMetaBox')); add_action('init', array($WidgetArea, 'adminInit')); add_action('save_post', array($WidgetArea, 'adminSaveMetaBox')); add_action('add_meta_boxes', array($WidgetArea, 'adminInitMetaBox')); add_filter('manage_edit-' . THEME_CONTEXT . '_widget_area_columns', array($WidgetArea, 'adminManageEditColumn')); add_action('manage_' . THEME_CONTEXT . '_widget_area_posts_custom_column', array($WidgetArea, 'adminManageColumn')); add_filter('manage_edit-' . THEME_CONTEXT . '_widget_area_sortable_columns', array($WidgetArea, 'adminManageEditSortableColumn')); add_action('wp_ajax_comment_add', array($Comment, 'addComment')); add_action('wp_ajax_nopriv_comment_add', array($Comment, 'addComment')); add_action('wp_ajax_comment_get', array($Comment, 'getComment')); add_action('wp_ajax_nopriv_comment_get', array($Comment, 'getComment')); add_action('tgmpa_register', array($this, 'addPlugin')); add_action('admin_notices', array($this, 'adminNotice')); add_action('init', array($MaintenanceMode, 'init')); /***/ $WidgetPostRecent->register(); $WidgetPostMostComment->register(); /***/ load_theme_textdomain(THEME_DOMAIN, THEME_PATH . 'languages/'); /***/ $install = (int) Themeoption::getOption('install'); if ($install == 1) { return; } $data = array(); $option = $this->themeDefaultOption; $Template = new ThemeTemplate($data, THEME_PATH_TEMPLATE . 'footer_bottom_content.php'); $option['footer_bottom_content'] = $Template->output(); $ResponsiveMode = new ThemeResponsiveMode($this->responsiveMode); $media = $ResponsiveMode->getMedia(); foreach ($media as $index => $value) { $option['custom_css_responsive_' . $index] = ''; } $optionCurrent = ThemeOption::getOptionObject(); $optionSave = array(); foreach ($option as $index => $value) { if (!array_key_exists($index, $optionCurrent)) { $optionSave[$index] = $value; } } $optionSave = array_merge($optionSave, $optionCurrent); foreach ($optionSave as $index => $value) { if (!array_key_exists($index, $option)) { unset($optionSave[$index]); } } $optionSave['install'] = 1; ThemeOption::resetOption(); ThemeOption::updateOption($optionSave); $GoogleFont = new ThemeGoogleFont(); $GoogleFont->download(); $this->createCSSFile(); /***/ $argument = array('post_type' => array('post', 'page'), 'post_status' => 'any', 'posts_per_page' => -1); $query = new WP_Query($argument); if ($query === false) { return; } foreach ($query->posts as $value) { $meta = ThemeOption::getPostMeta($value); if (is_array($meta)) { continue; } $meta = array('menu_top' => -1, 'widget_area_sidebar' => -1, 'widget_area_sidebar_location' => -1, 'widget_area_footer' => -1, 'footer_bottom_enable' => -1, 'header_enable' => -1, 'header_background_image_repeat' => -1, 'header_background_image_size_1' => -1); if ($value->post_type == 'post') { $meta['post_type'] = 'image'; $meta['post_tag_visible'] = -1; $meta['post_author_visible'] = -1; $meta['post_category_visible'] = -1; $meta['post_comment_count_visible'] = -1; $meta['post_navigation_visible'] = -1; } update_post_meta($value->ID, THEME_OPTION_PREFIX, $meta); } }
echo $Menu->create(); ?> <div class="theme-page"<?php echo ThemeHelper::createStyleAttribute(array('background-color' => ThemeColor::getColor($meta['page_background_color']))); ?> > <?php echo $Page->displayHeader($fable_parentPost->post); $template = $Page->getCurrentTemplate(); if ($template == 'main.php') { ?> <div class="theme-page-content theme-clear-fix"> <?php } else { $WidgetArea = new ThemeWidgetArea(); $widgetAreaData = $WidgetArea->getWidgetAreaByPost($fable_parentPost->post, true, true); $class = $WidgetArea->getWidgetAreaCSSClass($widgetAreaData); ?> <div class="theme-page-content theme-clear-fix theme-main <?php echo $class; ?> "> <?php if ($widgetAreaData['location'] == 1) { ?> <div class="theme-column-left"><?php $WidgetArea->create($widgetAreaData); ?> </div> <div class="theme-column-right">
static function getPostMeta($post) { $id = is_object($post) ? $post->ID : (int) $post; $meta = get_post_meta($id, THEME_OPTION_PREFIX, false); if (isset($meta[0])) { $meta = $meta[0]; } $postType = get_post_type($id); if (in_array($postType, array(THEME_CONTEXT . '_widget_area'))) { return $meta; } $Theme = new Theme(); $Post = new ThemePost(); $Page = new ThemePage(); $WidgetArea = new ThemeWidgetArea(); $Theme->setPostMetaDefault($meta, 'all'); switch ($postType) { case 'post': $Post->setPostMetaDefault($meta); break; case 'page': $Page->setPostMetaDefault($meta); break; case THEME_CONTEXT . '_widget_area': $WidgetArea->setPostMetaDefault($meta); break; } return $meta; }