Example #1
0
<?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();
        ?>
Example #2
0
<?php

ob_start();
?>
<!DOCTYPE html>
<?php 
global $post, $fable_parentPost;
$Theme = new Theme();
$Post = new ThemePost();
$Page = new ThemePage();
$Menu = new ThemeMenu();
$Validation = new ThemeValidation();
if (($fable_parentPost = $Post->getPost()) === false) {
    $fable_parentPost = new stdClass();
    $fable_parentPost->post = $post;
}
$meta = ThemeOption::getPostMeta($post);
ThemeHelper::removeUIndex($meta, 'page_background_color');
?>
		<html xmlns="http://www.w3.org/1999/xhtml" <?php 
language_attributes();
?>
>

			<head>
				<title><?php 
wp_title('|');
?>
</title> 
				<meta http-equiv="Content-Type" content="<?php 
bloginfo('html_type');
    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;
    }
<?php

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') {
<?php

$Post = new ThemePost();
$query = $Post->getPostRecent($this->data['instance']);
if ($query) {
    $id = 'widget_theme_widget_post_most_recent_' . ThemeHelper::createId();
    echo $this->data['html']['start'];
    ?>
			<div class="widget_theme_widget_post_most_recent theme-clear-fix" id="<?php 
    echo esc_attr($id);
    ?>
">
				
				<ul class="theme-reset-list">
<?php 
    global $post;
    $bPost = $post;
    while ($query->have_posts()) {
        $query->the_post();
        $Post->formatPostDate($post->post_date, $day, $month, $year, 2);
        ?>
					<li class="theme-clear-fix">
<?php 
        if (has_post_thumbnail()) {
            ?>
						<a href="<?php 
            the_permalink();
            ?>
">
							<?php 
            echo get_the_post_thumbnail(get_the_ID(), 'thumbnail');
<?php

$Post = new ThemePost();
$query = $Post->getPostRecent($this->data['instance']);
if ($query) {
    $id = 'widget_theme_widget_post_most_comment_' . ThemeHelper::createId();
    echo $this->data['html']['start'];
    ?>
			<div class="widget_theme_widget_post_most_comment theme-clear-fix" id="<?php 
    echo esc_attr($id);
    ?>
">
				
				<ul class="theme-reset-list">
<?php 
    global $post;
    $bPost = $post;
    while ($query->have_posts()) {
        $query->the_post();
        ?>
					<li class="theme-clear-fix">
<?php 
        if (has_post_thumbnail()) {
            ?>
						<a href="<?php 
            the_permalink();
            ?>
">
							<?php 
            echo get_the_post_thumbnail(get_the_ID(), 'thumbnail');
            ?>
 static function getOptionPostfix()
 {
     $Post = new ThemePost();
     return $Post->isWooCommercePost() ? 'woocommerce' : null;
 }
<?php

$Post = new ThemePost();
$query = $Post->getPostMostComment($this->data['instance']);
if ($query) {
    $id = 'widget_theme_widget_post_most_comment_' . ThemeHelper::createId();
    echo $this->data['html']['start'];
    ?>
			<div class="widget_theme_widget_post_most_comment theme-clear-fix" id="<?php 
    echo esc_attr($id);
    ?>
">
				
				<ul class="theme-reset-list">
<?php 
    global $post;
    $bPost = $post;
    while ($query->have_posts()) {
        $query->the_post();
        ?>
					<li class="theme-clear-fix">
<?php 
        if (has_post_thumbnail()) {
            ?>
						<a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            echo sprintf(esc_attr('View post "%s"', THEME_DOMAIN), get_the_title());
            ?>
"><?php