コード例 #1
0
ファイル: index.php プロジェクト: mattmcgiv/etp-almera-theme
 public static function admin_init()
 {
     self::$effects = array('' => __("No classes", 'almera'), 'alpha' => __("Alpha", 'almera'), 'omega' => __("Omega", 'almera'));
     //***
     add_meta_box("layout_constructor", __("Layout constructor", 'almera'), array(__CLASS__, 'draw_page_meta_box'), "page", "normal", "high");
     add_meta_box("layout_constructor", __("Layout constructor", 'almera'), array(__CLASS__, 'draw_page_meta_box'), "post", "normal", "high");
     //***
     $is_tmm_theme_options = FALSE;
     if (isset($_GET['page'])) {
         if ($_GET['page'] == 'tmm_theme_options') {
             $is_tmm_theme_options = TRUE;
         }
     }
     if ($is_tmm_theme_options === FALSE) {
         wp_enqueue_script('tmm_ext_layout_constructor', self::get_application_uri() . '/js/general.js', array('jquery', 'jquery-ui-core', 'jquery-ui-sortable'));
         wp_enqueue_style('tmm_ext_layout_constructor_popup3', self::get_application_uri() . '/js/tmm_popup/styles.css');
         wp_enqueue_script('tmm_ext_layout_constructor_popup3', self::get_application_uri() . '/js/tmm_popup/tmm_advanced_wp_popup.js', array('jquery'));
     }
     //***
 }
コード例 #2
0
			</li>
		<?php 
    }
    ?>
	<?php 
}
?>
</ul>


<div style="display: none;">
	<div id="layout_constructor_column_item">
		<?php 
$col_data = array('row' => '__ROW_ID__', 'uniqid' => '__UNIQUE_ID__', 'css_class' => 'element1-4', 'front_css_class' => 'four columns', 'value' => '1/4', 'content' => '', 'title' => '', 'effect' => '');
TMM_Ext_LayoutConstructor::draw_column_item($col_data);
?>
	</div>
	<div id="layout_constructor_column_row">
		<li id="layout_constructor_row___ROW_ID__" class="layout_constructor_item">
			<table>
				<tr>
					<td>
						<a href="javascript:tmm_ext_layout_constructor.add_column(__ROW_ID__);void(0);" class="button" style="width: 110px;text-align:center;margin-right:5px;"><?php 
_e("Add Column", 'almera');
?>
</a><br />
						<a href="javascript:tmm_ext_layout_constructor.edit_row(__ROW_ID__);void(0);" class="button" style="width: 45px;"><?php 
_e("Edit", 'almera');
?>
</a><a href="javascript:tmm_ext_layout_constructor.delete_row(__ROW_ID__);void(0);" class="button" style="width: 60px;margin:0 0 0 5px;"><?php 
コード例 #3
0
			<?php 
        }
        ?>
			<br />
			<!--<div class="nine columns offset-by-one alpha omega" style="padding-left: 0;">-->
			<div class="">

				<?php 
        the_content();
        if (function_exists('tmm_link_pages')) {
            tmm_link_pages();
        } else {
            wp_link_pages();
        }
        if (class_exists('TMM_Ext_LayoutConstructor')) {
            TMM_Ext_LayoutConstructor::draw_front(get_the_ID());
        }
        ?>

			</div><!--/ .nine-columns-->

		</article><!--/ .entry-->

	<?php 
    }
}
$next_post = get_next_post();
$prev_post = get_previous_post();
if ($prev_post) {
    ?>
	<a href="<?php 
コード例 #4
0
            <div class="<?php 
        if (!TMM::get_option("single_folio_hide_metadata") == 1) {
            ?>
ten<?php 
        } else {
            ?>
sixteen<?php 
        }
        ?>
 columns">

                <?php 
        the_content();
        ?>
                <?php 
        TMM_Ext_LayoutConstructor::draw_front($post->ID);
        ?>
	



            </div><!--/ .columns-->


            <?php 
        $page_social_likes = TMM::get_option('folio_page_social_likes');
        ?>

            <?php 
        if (!empty($page_social_likes)) {
            ?>
コード例 #5
0
function ajax_load_content()
{
    $type = $_POST['data_type'];
    $id = $_POST['data_id'];
    $page_paged = $_POST['datapaged'];
    if ($type == 'p') {
        $query = new WP_Query('post_type=post&p=' . $id);
        ob_start();
        if ($query->have_posts()) {
            while ($query->have_posts()) {
                $query->the_post();
                global $wp_query;
                $wp_query->is_single = 1;
                $wp_query->query_vars = $query->query_vars;
                $wp_query->posts = $query->posts;
                $wp_query->post_count = $query->post_count;
                $wp_query->query = $query->query;
                $wp_query->tax_query = $query->tax_query;
                get_template_part('single', null);
            }
        } else {
            get_template_part('index', null);
        }
        $response = ob_get_contents();
        ob_end_clean();
    } else {
        if ($type == 'page_id') {
            if (!empty($page_paged)) {
                $query = new WP_Query('post_type=page&paged=' . $page_paged . '&page_id=' . $id);
            } else {
                $query = new WP_Query('post_type=page&page_id=' . $id);
            }
            ob_start();
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    global $wp_query;
                    $wp_query->is_page = 1;
                    $wp_query->query_vars = $query->query_vars;
                    //	TMM_OptionsHelper::enqueue_script('stapel');
                    if (is_page_template('template-blog.php')) {
                        $wp_query->is_archive = 1;
                        get_template_part('template', 'blog');
                    } else {
                        if (is_page_template('template-home1.php')) {
                            get_template_part('template', 'home1');
                        } else {
                            if (is_page_template('template-home2.php')) {
                                get_template_part('template', 'home2');
                            } else {
                                if (is_page_template('template-home3.php')) {
                                    get_template_part('template', 'home3');
                                } else {
                                    if (is_page_template('template-testimonials.php')) {
                                        get_template_part('template', 'testimonials');
                                    } else {
                                        get_header();
                                        the_content();
                                        TMM_Ext_LayoutConstructor::draw_front(get_the_ID());
                                        //$page_social_likes = get_post_meta(get_the_ID(), 'page_social_likes', TRUE);
                                        if (!empty($page_social_likes)) {
                                            ?>
                            <div class="shr"></div>
                            <ul class="social-likes">

                                <?php 
                                            $page_social_likes = explode(",", $page_social_likes);
                                            foreach ($page_social_likes as $page_social_like) {
                                                switch ($page_social_like) {
                                                    case 'facebook_btn':
                                                        ?>
                                            <li class="facebook" title="Like">Facebook</li>
                                            <?php 
                                                        break;
                                                    case 'twitter_btn':
                                                        ?>
                                            <li class="twitter" title="Like">Twitter</li>
                                            <?php 
                                                        break;
                                                    case 'google_btn':
                                                        ?>
                                            <li class="plusone" data-counter="<?php 
                                                        the_permalink();
                                                        ?>
/googleplusonecount.php?url={url}&amp;callback=?" title="Like">Google+</li>
                                            <?php 
                                                        break;
                                                    case 'pinterest_btn':
                                                        ?>
                                            <li class="pinterest" title="Like" data-media="<?php 
                                                        echo TMM_Helper::get_post_featured_image($post->ID, '');
                                                        ?>
">Pinterest</li>
                                            <?php 
                                                        break;
                                                }
                                            }
                                            ?>
                            </ul>
                            <?php 
                                        }
                                        get_footer();
                                    }
                                }
                            }
                        }
                    }
                }
            } else {
                get_template_part('index', null);
            }
            $response = ob_get_contents();
            ob_end_clean();
        } else {
            if ($type == 'gall') {
                if (ctype_digit($id)) {
                    $query = new WP_Query('post_type=gall&p=' . $id);
                } else {
                    $query = new WP_Query('post_type=gall&name=' . $id);
                }
                ob_start();
                if ($query->have_posts()) {
                    while ($query->have_posts()) {
                        $query->the_post();
                        global $wp_query;
                        $wp_query->is_single = 1;
                        $wp_query->query_vars = $query->query_vars;
                        $wp_query->posts = $query->posts;
                        $wp_query->post_count = $query->post_count;
                        $wp_query->query = $query->query;
                        $wp_query->tax_query = $query->tax_query;
                        //	TMM_OptionsHelper::enqueue_script('cycle');
                        //	TMM_OptionsHelper::enqueue_script('isotope');
                        get_template_part('single', 'gall');
                    }
                } else {
                    get_template_part('index', null);
                }
                $response = ob_get_contents();
                ob_end_clean();
            } else {
                if ($type == 'folio') {
                    if (ctype_digit($id)) {
                        $query = new WP_Query('post_type=folio&p=' . $id);
                    } else {
                        if ($id == 'archive') {
                            $query = new WP_Query('post_type=folio');
                        } else {
                            $query = new WP_Query('post_type=folio&name=' . $id);
                        }
                    }
                    ob_start();
                    if ($query->have_posts()) {
                        while ($query->have_posts()) {
                            $query->the_post();
                            global $wp_query;
                            $wp_query->query_vars = $query->query_vars;
                            $wp_query->posts = $query->posts;
                            $wp_query->post_count = $query->post_count;
                            $wp_query->query = $query->query;
                            $wp_query->tax_query = $query->tax_query;
                            if ($id == 'archive') {
                                $wp_query->is_archive = 1;
                                get_template_part('archive', 'folio');
                            } else {
                                $wp_query->is_single = 1;
                                get_template_part('single', 'folio');
                            }
                        }
                    } else {
                        get_template_part('index', null);
                    }
                    $response = ob_get_contents();
                    ob_end_clean();
                } else {
                    if ($type == 'cat') {
                        $query = new WP_Query('cat=' . $id);
                        ob_start();
                        if ($query->have_posts()) {
                            while ($query->have_posts()) {
                                $query->the_post();
                                global $wp_query;
                                $wp_query->is_category = 1;
                                $wp_query->is_archive = 1;
                                $wp_query->query_vars = $query->query_vars;
                                $wp_query->posts = $query->posts;
                                $wp_query->post_count = $query->post_count;
                                $wp_query->query = $query->query;
                                $wp_query->tax_query = $query->tax_query;
                                get_template_part('category', null);
                            }
                        } else {
                            get_template_part('index', null);
                        }
                        $response = ob_get_contents();
                        ob_end_clean();
                    } else {
                        if ($type == 'tag') {
                            $query = new WP_Query('tag=' . $id);
                            ob_start();
                            if ($query->have_posts()) {
                                while ($query->have_posts()) {
                                    $query->the_post();
                                    global $wp_query;
                                    $wp_query->is_tag = 1;
                                    $wp_query->is_archive = 1;
                                    $wp_query->query_vars = $query->query_vars;
                                    $wp_query->posts = $query->posts;
                                    $wp_query->post_count = $query->post_count;
                                    $wp_query->query = $query->query;
                                    $wp_query->tax_query = $query->tax_query;
                                    get_template_part('tag', null);
                                }
                            } else {
                                get_template_part('tag', null);
                            }
                            $response = ob_get_contents();
                            ob_end_clean();
                        } else {
                            if ($type == 'm') {
                                $year = substr($id, 0, 4);
                                $monthnum = substr($id, 5);
                                $query = new WP_Query('year=' . $year . '&monthnum=' . $monthnum);
                                ob_start();
                                if ($query->have_posts()) {
                                    while ($query->have_posts()) {
                                        $query->the_post();
                                        global $wp_query;
                                        $wp_query->is_archive = 1;
                                        $wp_query->query_vars = $query->query_vars;
                                        $wp_query->posts = $query->posts;
                                        $wp_query->post_count = $query->post_count;
                                        $wp_query->query = $query->query;
                                        $wp_query->tax_query = $query->tax_query;
                                        get_template_part('archive', null);
                                    }
                                } else {
                                    get_template_part('tag', null);
                                }
                                $response = ob_get_contents();
                                ob_end_clean();
                            }
                        }
                    }
                }
            }
        }
    }
    echo $response;
    die;
}