public static function show_edit_columns_content($column)
 {
     global $post;
     switch ($column) {
         case "image":
             echo '<img alt="" src="' . TMM_Helper::get_post_featured_image($post->ID, '200*200', true) . '"/>';
             break;
         case "image_count":
             $custom = get_post_custom($post->ID);
             $tmm_gallery = unserialize(@$custom["thememakers_gallery"][0]);
             if (empty($tmm_gallery)) {
                 $tmm_gallery = array();
             }
             echo count($tmm_gallery);
             break;
     }
 }
Exemple #2
0
 public static function show_edit_columns_content($column)
 {
     global $post;
     switch ($column) {
         case "image":
             echo '<img alt="" src="' . TMM_Helper::get_post_featured_image($post->ID, '200*200', true) . '"/>';
             break;
         case "twitter":
             echo get_post_meta($post->ID, 'twitter', true);
             break;
         case "facebook":
             echo get_post_meta($post->ID, 'facebook', true);
             break;
         case "dribble":
             echo get_post_meta($post->ID, 'dribble', true);
             break;
     }
 }
 public static function show_edit_columns_content($column)
 {
     global $post;
     switch ($column) {
         case "image":
             echo '<div style="width:400px;">';
             echo '<img alt="" src="' . TMM_Helper::get_post_featured_image($post->ID, '200*200', true) . '"/>';
             echo '</div>';
             break;
         case "description":
             the_excerpt();
             break;
         case "tags":
             echo get_the_tag_list('', '', '', $post->ID);
             break;
         case "foliocat":
             echo get_the_term_list($post->ID, 'foliocat', '', ', ', '');
             break;
     }
 }
Exemple #4
0
 public static function show_edit_columns_content($column)
 {
     global $post;
     switch ($column) {
         case "image":
             echo '<img alt="' . $post->post_title . '" src="' . TMM_Helper::get_post_featured_image($post->ID, '200*200', true) . '"/>';
             break;
         case "count":
             echo self::get_page_slides_count($post->ID);
             break;
     }
 }
    $cats = wp_get_post_terms($post->ID, 'folio_category');
    foreach ($cats as $key => $value) {
        if ($key > 0) {
            echo ' / ';
        }
        echo $value->name;
    }
    ?>
								</h6>

								<a class="single-image link-icon" href="<?php 
    the_permalink();
    ?>
">Permalink</a>
								<a class="single-image plus-icon" data-fancybox-group="folio" href="<?php 
    echo TMM_Helper::get_post_featured_image($post->ID, '');
    ?>
">Image</a>							

							</div><!--/ .inner-extra-->

						</div><!--/ .extra-content-->

					</div><!--/ .image-extra-->

				</div><!--/ .work-item-->

			</li><!--/ .mix-->
			
		<?php 
}
    while ($query->have_posts()) {
        $query->the_post();
        ?>

				<li>

					<?php 
        if ($instance['show_thumbnail'] == 'true') {
            ?>
							<div class="image-holder">
								<a href="<?php 
            the_permalink();
            ?>
">
									<img src="<?php 
            echo TMM_Helper::get_post_featured_image($post->ID, '60*60', true);
            ?>
" alt="<?php 
            the_title();
            ?>
">
								</a>
							</div>
						
					<?php 
        }
        ?>

					<div class="post-holder">
						<h6><a href="<?php 
        the_permalink();
Exemple #7
0
        echo $animation;
    }
    ?>
">
			<input type="checkbox" class="state" id="acc-<?php 
    echo $i;
    ?>
" />
			<label class="backdrop" for="acc-<?php 
    echo $i;
    ?>
"><i class="fa fa-times"></i></label>
			<article class="acc_cBox">
				<div class="acc_cImg">
					<img src="<?php 
    echo TMM_Helper::get_post_featured_image($post_id, '252*270');
    ?>
" alt="" />
					<header>
						<h3><?php 
    echo get_the_title($post_id);
    ?>
</h3>
						<h5><?php 
    $post_categories = wp_get_post_terms($post_id, 'position', array("fields" => "names"));
    if (!empty($post_categories)) {
        foreach ($post_categories as $key => $value) {
            if ($key > 0) {
                echo ' / ';
            }
            echo $value;
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;
}
    <section class="recent-projects">
        <?php 
    if ($query->have_posts()) {
        while ($query->have_posts()) {
            $query->the_post();
            ?>
                <article class="four columns">

                    <div class="project-thumb">

                        <a href="<?php 
            echo TMM_Helper::get_post_featured_image($post->ID, '');
            ?>
" class="single-image plus-icon animTop" title="" rel="gallery">
                            <img src="<?php 
            echo TMM_Helper::get_post_featured_image($post->ID, '420*300', true);
            ?>
" alt="<?php 
            the_title();
            ?>
" />
                        </a>


                        <a href="<?php 
            the_permalink();
            ?>
" class="project-meta">
                            <h5 class="title"><?php 
            the_title();
            ?>
Exemple #10
0
        public function enqueue_scripts()
        {
            wp_register_script('tmm_addthis_widget', 'http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f3c188f442f3bf2', array(), false, true);
            global $post;
            if (get_post_type() === 'post') {
                $post_pod_type = get_post_meta($post->ID, 'post_pod_type', true);
                $thumb_src = TMM_Helper::get_post_featured_image($post->ID, '840*500');
                if ($post_pod_type === 'video_test') {
                    //todo: share video on facebook in testing mode
                    $post_type_values = get_post_meta(get_the_ID(), 'post_type_values', true);
                    $source_url = $post_type_values['video'];
                    if (!has_post_thumbnail()) {
                        if (strpos($source_url, "youtube.com") !== false || strpos($source_url, "youtu.be") !== false) {
                            if (strpos($source_url, "youtube.com") !== false || strpos($source_url, "youtu.be") !== false) {
                                $video_youtube = explode("?v=", $source_url);
                            } else {
                                $video_youtube = explode("youtu.be/", $source_url);
                            }
                            if (!empty($video_youtube[1])) {
                                $thumb_src = 'http://img.youtube.com/vi/' . $video_youtube[1] . '/default.jpg';
                            }
                        } else {
                            if (strpos($source_url, "vimeo.com") !== false) {
                                $arr = parse_url($source_url);
                                if (!empty($arr['path'])) {
                                    $xml = simplexml_load_file('http://vimeo.com/api/v2/video' . $arr['path'] . '.xml');
                                    if ($xml) {
                                        $thumb_src = (string) $xml->video->thumbnail_medium;
                                    }
                                }
                            }
                        }
                    }
                    if (!empty($source_url)) {
                        ?>
				        <meta property="og:url"                content="<?php 
                        the_permalink();
                        ?>
" />
				        <meta property="og:type"               content="article" />
				        <meta property="og:video"              content="<?php 
                        echo $source_url;
                        ?>
" />
				        <meta property="og:video:secure_url"   content="<?php 
                        echo $source_url;
                        ?>
" />
				        <meta property="og:image"              content="<?php 
                        echo $thumb_src;
                        ?>
" />
				        <?php 
                    }
                } else {
                    if (!has_post_thumbnail()) {
                        if ($post_pod_type === 'gallery') {
                            $post_type_values = get_post_meta(get_the_ID(), 'post_type_values', true);
                            $gall = $post_type_values['gallery'];
                            $thumb_src = $gall[0];
                            if (is_multisite()) {
                                $path = wp_upload_dir();
                                $temp = explode('wp-content/uploads', $thumb_src);
                                $thumb_src = $path['baseurl'] . $temp[1];
                            }
                        }
                    }
                    ?>
			        <meta property="og:url"                content="<?php 
                    the_permalink();
                    ?>
" />
			        <meta property="og:type"               content="article" />
			        <meta property="og:image"              content="<?php 
                    echo $thumb_src;
                    ?>
" />
			        <meta property="og:image:width"        content="840" />
			        <meta property="og:image:height"       content="500" />
		            <?php 
                }
            } else {
                if (class_exists('TMM_Ext_PostType_Car') && get_post_type() === TMM_Ext_PostType_Car::$slug) {
                    $thumb_src = tmm_get_car_cover_image($post->ID, 'thumb');
                    ?>
		        <meta property="og:url"                content="<?php 
                    the_permalink();
                    ?>
" />
		        <meta property="og:type"               content="article" />
		        <meta property="og:image"              content="<?php 
                    echo $thumb_src;
                    ?>
" />
		        <meta property="og:image:width"        content="460" />
		        <meta property="og:image:height"       content="290" />
	            <?php 
                } else {
                    ?>
		        <meta property="og:url"            content="<?php 
                    the_permalink();
                    ?>
" />
		        <meta property="og:title"          content="<?php 
                    the_title();
                    ?>
" />
		        <meta property="og:description"    content="<?php 
                    the_excerpt();
                    ?>
" />
				<?php 
                }
            }
        }
 public static function get_post_featured_image($post_id, $size)
 {
     if (class_exists('TMM_Helper')) {
         return TMM_Helper::get_post_featured_image($post_id, $size);
     }
     $src = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'single-post-thumbnail');
     return $src[0];
 }
		<ul class="recent-projects">
			<?php 
if ($query->have_posts()) {
    while ($query->have_posts()) {
        $query->the_post();
        ?>
					<li>
						<?php 
        if ($instance['show_thumbnail'] == 'true') {
            ?>
								<a class="single-image link-icon" href="<?php 
            the_permalink();
            ?>
">
									<img src="<?php 
            echo TMM_Helper::get_post_featured_image($post->ID, '440*270', true);
            ?>
" alt="<?php 
            the_title();
            ?>
">
								</a>
							
						<?php 
        }
        ?>

						<?php 
        if ($instance['show_title']) {
            ?>
							<h6><a href="<?php 
						<?php 
                }
                ?>
						<?php 
                break;
            default:
                ?>
						<?php 
                if (has_post_thumbnail()) {
                    ?>
							<a href="<?php 
                    the_permalink();
                    ?>
" class="single-image link-icon"><img src="<?php 
                    echo TMM_Helper::get_post_featured_image($post->ID, $thumb_size);
                    ?>
" alt="<?php 
                    the_title();
                    ?>
" /></a>
						<?php 
                }
                ?>
						<?php 
                break;
        }
        ?>

				<?php 
        if (TMM::get_option("blog_listing_show_date")) {
        ?>
			<li class="align-center">
				<blockquote class="quote-text">
					<p><?php 
        the_content();
        ?>
</p>
				</blockquote>
				<?php 
        if ($show_photo) {
            ?>
					<div class="quote-image"><img alt="<?php 
            the_title();
            ?>
" src="<?php 
            echo TMM_Helper::get_post_featured_image(get_the_ID(), '70*70');
            ?>
"></div>
				<?php 
        }
        ?>
				<div class="quote-author"><span><?php 
        the_title();
        ?>
, <?php 
        echo get_post_meta(get_the_ID(), 'position', true);
        ?>
</span></div>
			</li>	
			<?php 
    }