Example #1
0
function thesis_teaser($classes, $post_count = false, $right = false)
{
    $classes = 'teaser';
    $post_image = thesis_post_image_info('thumb');
    if ($right) {
        $classes .= ' teaser_right';
    }
    thesis_hook_before_teaser_box($post_count);
    #hook
    ?>
			<div <?php 
    post_class($classes);
    ?>
 id="post-<?php 
    the_ID();
    ?>
">
<?php 
    thesis_build_teaser($post_count, $post_image);
    ?>
			</div>

<?php 
    thesis_hook_after_teaser_box($post_count);
    #hook
    echo $close_box;
}
Example #2
0
function thesis_post_box($classes = '', $post_count = false)
{
    $post_image = thesis_post_image_info('image');
    thesis_hook_before_post_box($post_count);
    echo "\t\t\t<div class=\"" . join(' ', get_post_class($classes)) . "\" id=\"post-" . get_the_ID() . "\">\n";
    thesis_hook_post_box_top($post_count);
    thesis_headline_area($post_count, $post_image);
    echo "\t\t\t\t<div class=\"format_text entry-content\">\n";
    thesis_post_content($post_count, $post_image);
    echo "\t\t\t\t</div>\n";
    thesis_hook_post_box_bottom($post_count);
    echo "\t\t\t</div>\n\n";
    thesis_hook_after_post_box($post_count);
}
Example #3
0
function thesis_add_image_to_feed($content)
{
    if (is_feed()) {
        $post_image = thesis_post_image_info('image');
        return '<p>' . $post_image['output'] . '</p>' . $content;
    } else {
        return $content;
    }
}
Example #4
0
    function archive()
    {
        global $thesis_design;
        thesis_archive_intro();
        if ($thesis_design->display['archives']['style'] == 'titles') {
            $post_count = 1;
            while (have_posts()) {
                the_post();
                $classes = 'post_box';
                $post_image = thesis_post_image_info('image');
                if ($post_count == 1) {
                    $classes .= ' top';
                }
                thesis_hook_before_post_box($post_count);
                ?>
			<div <?php 
                post_class($classes);
                ?>
 id="post-<?php 
                the_ID();
                ?>
">
<?php 
                thesis_headline_area($post_count, $post_image);
                ?>
			</div>

<?php 
                thesis_hook_after_post_box($post_count);
                $post_count++;
            }
        } else {
            call_user_func(apply_filters('thesis_custom_loop', array('thesis_loop', 'home')));
        }
    }
    /**
     * Display the widget on the screen.
     */
    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        echo $before_widget;
        if (!empty($title)) {
            echo $before_title . $title . $after_title;
        }
        $carouselType = true ? 'page' : 'item';
        $q = array();
        if ($instance['cat_ID']) {
            array_push($q, 'cat=' . $instance['cat_ID']);
        }
        if ($instance['number']) {
            array_push($q, 'showposts=' . $instance['number']);
        }
        $my_query = new WP_Query(implode('&', $q));
        ?>
		<div class="box carousel <?php 
        echo $carouselType;
        ?>
">
			<?php 
        if ($carouselType == 'page' && $my_query->post_count) {
            echo '<ul class="jcarousel-control">';
            for ($i = 0; $i < $my_query->post_count; $i++) {
                echo '<li><a href="#"><span>' . ($i + 1) . '</span></a></li>';
            }
            echo '</ul>';
        }
        ?>
			<ul id="carousel">
				<?php 
        /*$q = array();
        		if ($instance['cat_ID']) {
        			array_push($q, 'cat=' . $instance['cat_ID']);
        		}
        		if ($instance['number']) {
        			array_push($q, 'showposts=' . $instance['number']);
        		}
        		$my_query = new WP_Query(implode('&', $q));*/
        while ($my_query->have_posts()) {
            $my_query->the_post();
            $do_not_duplicate = $post->ID;
            ?>
				<li>
					<?php 
            if ($carouselType == 'page') {
                ?>
						<?php 
                the_content();
                ?>
					<?php 
            } else {
                ?>
					<div class="content">
						<div class="text">
							<h2><a href="javascript:void(0);"><?php 
                the_title();
                ?>
</a></h2>
							<h3><?php 
                echo get_post_meta(get_the_ID(), 'user_title', true);
                ?>
</h3>
							<div class="moreInfo" style="display:none;">
								<div class="post_box top">
									<div class="headline_area">
										<h1><?php 
                the_title();
                ?>
</h1>
									</div>
									<div class="format_text">
										<?php 
                the_content();
                ?>
									</div>
								</div>
							</div>
						</div>
						<?php 
                $post_image = thesis_post_image_info('image');
                echo $post_image['output'];
                ?>
					</div>
					<?php 
            }
            ?>
				</li>
				<?php 
        }
        ?>
			</ul>
		</div>
		
		<script type="text/javascript">
		<?php 
        if ($carouselType == 'page') {
            ?>
		$(document).ready(function() {
			$('#carousel').jcarousel({
				scroll: 1,
				wrap: 'both',
				buttonNextHTML: '',
				buttonPrevHTML: '',
				initCallback: function(carousel) {
					$('.jcarousel-control a').bind('click', function() {
						$('.jcarousel-control li').removeClass('selected');
						$(this).parent().addClass('selected');
						carousel.scroll($.jcarousel.intval($(this).text()));
						return false;
					});
				},
				itemVisibleInCallback: {
					onAfterAnimation: function(carousel, item, idx, state) {
						/*var h = $('img', item).height();
						$('.jcarousel-item').height(h);*/
						$('.jcarousel-control li').removeClass('selected');
						$('.jcarousel-control a.item_'+idx).parent().addClass('selected');
					}
				}
			});
		});
		<?php 
        } else {
            ?>
		$(document).ready(function() {
			$('#carousel').jcarousel({
				scroll: 1,
				wrap: 'both'
			});
			var content = $("#content");
			$('#carousel li').click(function() {
				var $this = $(this);
				$('#carousel li').removeClass('selected');
				$this.addClass('selected');
				content.detach();
				//console.log($this.find("div.moreInfo").html());
				$("#carousel_content_wrapper").html($this.find("div.moreInfo").html());
				return false;
			});
		});
		<?php 
        }
        ?>
		</script>
		<?php 
        echo $after_widget;
    }
Example #6
0
function thesis_archive_loop()
{
    global $thesis;
    thesis_hook_archive_info();
    if ($thesis['display']['archives']['style'] == 'titles') {
        $post_count = 1;
        while (have_posts()) {
            the_post();
            $classes = 'post_box';
            $post_image = thesis_post_image_info('image');
            if ($post_count == 1) {
                $classes .= ' top';
            }
            thesis_hook_before_post_box($post_count);
            ?>
			<div <?php 
            post_class($classes);
            ?>
 id="post-<?php 
            the_ID();
            ?>
">
				<?php 
            thesis_headline_area($post_count, $post_image);
            ?>
			</div>

<?php 
            thesis_hook_after_post_box($post_count);
            $post_count++;
        }
    } else {
        thesis_home_loop();
    }
}