?> > <div class="theme-main <?php echo $layout; ?> "> <?php $WidgetArea->create($widgetAreaData, true); ?> </div> </div> <?php } if (ThemeOption::getGlobalOption($post, 'footer_bottom_enable') == 1) { $content = ThemeOption::getOption('footer_bottom_content'); if ($Validation->isNotEmpty($content)) { ?> <div class="theme-footer-bottom theme-clear-fix"> <div class="theme-main theme-clear-fix"> <?php echo do_shortcode($content); ?> </div> </div> <?php } } ?> </div>
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(); ?> " <?php post_class('theme-clear-fix theme-post theme-post-type-' . (is_sticky() ? 'sticky' : $option['post_type'])); ?> > <?php $Post->formatPostDate($post->post_date, $day, $month, $year); $headerImportance = $widgetAreaData['location'] == 0 ? 2 : 4; ?> <div class="theme-post-section-header"> <h<?php echo $headerImportance;
function getWidgetAreaByPost($post, $sidebar = true, $widgetArea = true) { $data = array('id' => 0, 'location' => 0); if (is_home()) { return $data; } if (!$widgetArea) { return $data; } if (!is_object($post)) { return $data; } if ($sidebar) { $id = ThemeOption::getGlobalOption($post, 'widget_area_sidebar', ThemeOption::getOptionPostfix()); $location = ThemeOption::getGlobalOption($post, 'widget_area_sidebar_location', ThemeOption::getOptionPostfix()); } else { $id = ThemeOption::getGlobalOption($post, 'widget_area_footer', ThemeOption::getOptionPostfix()); $location = 1; } if (strcmp($id, '0') == 0) { return $data; } if (strcmp($location, '0') == 0) { return $data; } $post = get_post($id); if (is_null($post)) { return $data; } return array('id' => $id, 'location' => $location); }
function displayHeader($post) { $html = null; if (is_home()) { return $html; } $option = ThemeOption::getPostMeta($post); $Validation = new ThemeValidation(); if (ThemeOption::getGlobalOption($post, 'header_enable')) { ThemeHelper::removeUIndex($option, 'header_background_color', 'header_background_image_src', 'header_background_image_position', 'header_background_image_size_1', 'header_background_image_size_2', 'header_text_color', 'header_subheader_text_color', 'header_subheader'); $subheaderHTML = null; $style = array(array(), array(), array()); if ($Validation->isColor($option['header_background_color'])) { $style[0]['background-color'] = ThemeColor::getColor($option['header_background_color']); } if (!in_array($option['header_background_image_src'], array('-1', 'none'))) { if ($Validation->isNotEmpty($option['header_background_image_src'])) { $style[0]['background-image'] = 'url(\'' . $option['header_background_image_src'] . '\')'; } elseif ($Validation->isNotEmpty(ThemeOption::getGlobalOption(null, 'header_background_image_src'))) { $style[0]['background-image'] = 'url(\'' . ThemeOption::getGlobalOption(null, 'header_background_image_src') . '\')'; } } if (array_key_exists('background-image', $style[0])) { $style[0]['background-repeat'] = ThemeOption::getGlobalOption($post, 'header_background_image_repeat'); if ($Validation->isNotEmpty($option['header_background_image_position'])) { $style[0]['background-position'] = $option['header_background_image_position']; } elseif ($Validation->isNotEmpty(ThemeOption::getGlobalOption(null, 'header_background_image_position'))) { $style[0]['background-position'] = ThemeOption::getGlobalOption(null, 'header_background_image_position'); } $style[0]['background-size'] = ThemeOption::getGlobalOption($post, 'header_background_image_size_1'); if (in_array($style[0]['background-size'], array('length', 'percentage'))) { if ($Validation->isNotEmpty($option['header_background_image_size_2'])) { $style[0]['background-size'] = $option['header_background_image_size_2']; } elseif ($Validation->isNotEmpty(ThemeOption::getGlobalOption(null, 'header_background_image_size_2'))) { $style[0]['background-size'] = ThemeOption::getGlobalOption(null, 'header_background_image_size_2'); } } } if ($Validation->isColor($option['header_text_color'])) { $style[1]['color'] = ThemeColor::getColor($option['header_text_color']); } if ($Validation->isColor($option['header_subheader_text_color'])) { $style[2]['color'] = ThemeColor::getColor($option['header_subheader_text_color']); } if ($Validation->isNotEmpty($option['header_subheader'])) { $subheaderHTML = '<h6' . ThemeHelper::createStyleAttribute($style[2]) . '>' . $option['header_subheader'] . '</h6>'; } elseif ($post->post_type == 'post') { $Post = new ThemePost(); $Post->formatPostDate($post->post_date, $day, $month, $year); $subheaderHTML = '<h6' . ThemeHelper::createStyleAttribute($style[2]) . '>' . $month . ' ' . $day . ', ' . $year . '</h6>'; } $html = ' <div class="theme-page-header" ' . ThemeHelper::createStyleAttribute($style[0]) . '> <div class="theme-main"> <h1 ' . ThemeHelper::createStyleAttribute($style[1]) . '>' . $post->post_title . '</h1> ' . $subheaderHTML . ' </div> </div> '; } return $html; }
global $post, $fable_parentPost; the_post(); $Page = new ThemePage(); $Post = new ThemePost(); $Validation = new ThemeValidation(); $WidgetArea = new ThemeWidgetArea(); $widgetAreaData = $WidgetArea->getWidgetAreaByPost($fable_parentPost->post, true, true); $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()); $visibleOption['post_navigation_visible'] = ThemeOption::getGlobalOption($post, 'post_navigation_visible'); ?> <div <?php post_class('theme-clear-fix theme-post theme-post-type-' . (is_sticky() ? 'sticky' : $option['post_type'])); ?> id="post-<?php the_ID(); ?> "> <?php switch ($option['post_type']) { case 'audio': case 'video': case 'image_slider': if ($option['post_type'] == 'image_slider') { $option['post_type_preambule'] = preg_replace('/\\[pb_nivo_slider/', '[pb_nivo_slider url="' . get_permalink() . '" ', $option['post_type_preambule']);
function create() { global $fable_parentPost; $attribute = array(); $attribute['menu_id'] = 0; $menu = wp_get_nav_menus(); $menuLocation = get_nav_menu_locations(); $locationId = 'menu_top'; $Validation = new ThemeValidation(); if (isset($menuLocation[$locationId])) { foreach ($menu as $m) { if ($m->term_id == $menuLocation[$locationId]) { $attribute['menu_id'] = $m->term_id; } } } if ($attribute['menu_id'] == 0) { if (ThemeOption::getGlobalOption($fable_parentPost->post, 'menu_top') == 0) { return; } } if ($attribute['menu_id'] == 0) { $attribute['menu_id'] = ThemeOption::getGlobalOption($fable_parentPost->post, 'menu_top'); } $attribute['logo_src'] = ThemeOption::getOption('menu_logo_src'); $attribute['responsive_mode'] = ThemeOption::getOption('menu_responsive_mode'); $attribute['sticky_enable'] = ThemeOption::getOption('menu_sticky_enable'); $attribute['hide_scroll_enable'] = ThemeOption::getOption('menu_hide_scroll_enable'); $attribute['menu_animation_enable'] = ThemeOption::getOption('menu_animation_enable'); $attribute['menu_animation_speed_open'] = ThemeOption::getOption('menu_animation_speed_open'); $attribute['menu_animation_speed_close'] = ThemeOption::getOption('menu_animation_speed_close'); $attribute['menu_animation_delay'] = ThemeOption::getOption('menu_animation_delay'); $attribute['scroll_animation_enable'] = ThemeOption::getOption('menu_scroll_animation_enable'); $attribute['scroll_animation_speed'] = ThemeOption::getOption('menu_scroll_animation_speed'); $attribute['scroll_animation_easing'] = ThemeOption::getOption('menu_scroll_animation_easing'); $attribute['css_class'] = 'pb'; if (!class_exists('PBComponentMenu')) { $html = null; $logoHTML = null; $option = array(); $key = array('responsive_mode', 'sticky_enable', 'hide_scroll_enable', 'menu_animation_enable', 'menu_animation_speed_open', 'menu_animation_speed_close', 'menu_animation_delay', 'scroll_animation_enable', 'scroll_animation_speed', 'scroll_animation_easing'); foreach ($key as $value) { $option[$value] = $attribute[$value]; } $option['responsive_menu_id'] = ThemeHelper::createId('pb_menu_responsive'); $option['responsive_menu_label'] = __('Menu'); $id = ThemeHelper::createId('pb_menu'); $classLogo = array('pb-logo'); $classMenu = array('pb-menu-default'); $classMenuResponsive = array('pb-menu-responsive'); $class = array('pb-menu', $attribute['css_class']); $menuAttribute = array('menu' => $attribute['menu_id'], 'walker' => new ThemeMenuWalker(), 'menu_class' => 'sf-menu pb-reset-list pb-clear-fix', 'container' => '', 'container_class' => '', 'echo' => 0); $menuResponsiveAttribute = array('id' => $option['responsive_menu_id'], 'menu' => $attribute['menu_id'], 'walker' => new ThemeMenuResponsiveWalker(), 'menu_class' => 'pb-clear-fix', 'container' => '', 'container_class' => '', 'echo' => 0, 'items_wrap' => '<div id="%1$s" class="%2$s"><div id="' . $option['responsive_menu_id'] . '"><ul>%3$s</ul></div></div>'); if ($Validation->isURL($attribute['logo_src'])) { $logoHTML = ' <a href="' . get_home_url() . '"> <img src="' . esc_attr($attribute['logo_src']) . '" alt=""/> </a> '; } $html = ' <div' . ThemeHelper::createClassAttribute($class) . ' id="' . $id . '"> <div class="pb-main pb-clear-fix"> <div' . ThemeHelper::createClassAttribute($classLogo) . '> ' . $logoHTML . ' </div> <div' . ThemeHelper::createClassAttribute($classMenu) . '> ' . wp_nav_menu($menuAttribute) . ' </div> <div' . ThemeHelper::createClassAttribute($classMenuResponsive) . '> ' . wp_nav_menu($menuResponsiveAttribute) . ' </div> </div> </div> <div class="pb-script-tag"> <script type="text/javascript"> jQuery(document).ready(function($) { $(\'#' . $id . '\').menu(' . json_encode($option) . '); }); </script> </div> '; return $html; } else { $attributeString = null; foreach ($attribute as $index => $value) { $attributeString .= ' ' . $index . '="' . $value . '"'; } $shortcode = '[' . PLUGIN_PAGE_BUILDER_SHORTCODE_PREFIX . 'menu' . $attributeString . ']'; echo do_shortcode($shortcode); } }