Esempio n. 1
0
/**
* Custom markup for gallery posts in main blog index.
*/
function response_custom_gallery_post_format($content)
{
    global $options, $themeslug, $post;
    $root = get_template_directory_uri();
    ob_start();
    ?>
	
		<?php 
    if ($options->get($themeslug . '_post_formats') == '1') {
        ?>
			<div class="postformats"><!--begin format icon-->
				<img src="<?php 
        echo get_template_directory_uri();
        ?>
/images/formats/gallery.png" />
			</div><!--end format-icon-->
		<?php 
    }
    ?>
				<h2 class="posts_title"><a href="<?php 
    the_permalink();
    ?>
"><?php 
    the_title();
    ?>
</a></h2>
					<!--Call @Core Meta hook-->
			<?php 
    response_post_byline();
    ?>
				<?php 
    if (has_post_thumbnail() && $options->get($themeslug . '_show_featured_images') == '1' && !is_single()) {
        echo '<div class="featured-image">';
        echo '<a href="' . get_permalink($post->ID) . '" >';
        the_post_thumbnail();
        echo '</a>';
        echo '</div>';
    }
    ?>
	
				<div class="entry" <?php 
    if (has_post_thumbnail() && $options->get($themeslug . '_show_featured_images') == '1') {
        echo 'style="min-height: 115px;" ';
    }
    ?>
>
				
				<?php 
    if (!is_single()) {
        ?>
				<?php 
        $images = get_children(array('post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999));
        if ($images) {
            $total_images = count($images);
            $image = array_shift($images);
            $image_img_tag = wp_get_attachment_image($image->ID, 'thumbnail');
            ?>

				<figure class="gallery-thumb">
					<a href="<?php 
            the_permalink();
            ?>
"><?php 
            echo $image_img_tag;
            ?>
</a>
					<br /><br />
					This gallery contains <?php 
            echo $total_images;
            ?>
 images
					<?php 
        }
        ?>
				</figure><!-- .gallery-thumb -->
				<?php 
    }
    ?>
				
				<?php 
    if (is_single()) {
        ?>
					<?php 
        the_content();
        ?>
				<?php 
    }
    ?>
				</div><!--end entry-->

				<div style=clear:both;></div>
	<?php 
    $content = ob_get_clean();
    return $content;
}
Esempio n. 2
0
/**
* Check for post format type, apply filter based on post format name for easy modification.
*
* @since 1.0
*/
function response_loop_content($content)
{
    global $options, $themeslug, $post;
    //call globals
    if (is_single()) {
        $post_formats = $options->get($themeslug . '_single_post_formats');
        $featured_images = $options->get($themeslug . '_single_show_featured_images');
        $excerpts = $options->get($themeslug . '_single_show_excerpts');
    } elseif (is_archive()) {
        $post_formats = $options->get($themeslug . '_archive_post_formats');
        $featured_images = $options->get($themeslug . '_archive_show_featured_images');
        $excerpts = $options->get($themeslug . '_archive_show_excerpts');
    } else {
        $post_formats = $options->get($themeslug . '_post_formats');
        $featured_images = $options->get($themeslug . '_show_featured_images');
        $excerpts = $options->get($themeslug . '_show_excerpts');
    }
    if (get_post_format() == '') {
        $format = "default";
    } else {
        $format = get_post_format();
    }
    ?>
		
		<?php 
    ob_start();
    ?>
			
			<?php 
    if ($post_formats != '0') {
        ?>
			<div class="postformats"><!--begin format icon-->
				<img src="<?php 
        echo get_template_directory_uri();
        ?>
/images/formats/<?php 
        echo $format;
        ?>
.png" alt="formats" />
			</div><!--end format-icon-->
			<?php 
    }
    ?>
				<h2 class="posts_title"><a href="<?php 
    the_permalink();
    ?>
"><?php 
    the_title();
    ?>
</a></h2>
					<!--begin response_post_byline hook-->
						<?php 
    response_post_byline();
    ?>
					<!--end response_post_byline hook-->
				<?php 
    if (has_post_thumbnail() && $featured_images == '1') {
        echo '<div class="featured-image">';
        echo '<a href="' . get_permalink($post->ID) . '" >';
        the_post_thumbnail();
        echo '</a>';
        echo '</div>';
    }
    ?>
	
				<div class="entry" <?php 
    if (has_post_thumbnail() && $featured_images == '1' && !is_single()) {
        echo 'style="min-height: 115px;" ';
    }
    ?>
>
					<?php 
    if ($excerpts == '1' && !is_single()) {
        the_excerpt();
    } else {
        the_content(__('Read more...', 'response'));
    }
    ?>
				</div><!--end entry-->
		<?php 
    $content = ob_get_clean();
    $content = apply_filters('response_post_formats_' . $format . '_content', $content);
    echo $content;
}