Example #1
0
    while (have_posts()) {
        the_post();
        $image = '';
        // Create the featured image html
        if (has_post_thumbnail() && !post_password_required()) {
            $thumb = get_post_thumbnail_id($post->ID);
            $f_image = wp_get_attachment_url($thumb);
            if (!empty($f_image)) {
                if (isset($data['sb_archive_use_full_image']) && $data['sb_archive_use_full_image'] == 'yes') {
                    $image = '<div class="zn_full_image"><a data-rel="prettyPhoto" href="' . $f_image . '" class="hoverBorder">' . get_the_post_thumbnail($post->ID, 'full-width-image') . '</a></div>';
                } else {
                    $image = '<div class="zn_post_image"><a href="' . get_permalink() . '" class="hoverBorder pull-left">' . get_the_post_thumbnail() . '</a></div>';
                }
            }
        } elseif ($data['zn_use_first_image'] == 'yes' && !post_password_required()) {
            $f_image = echo_first_image();
            if (!empty($f_image)) {
                if (isset($data['sb_archive_use_full_image']) && $data['sb_archive_use_full_image'] == 'yes') {
                    $feature_image = wp_get_attachment_url($thumb);
                    $size = zn_get_size('sixteen', $has_sidebar, 30);
                    $image = vt_resize('', $f_image, $size['width'], '', true);
                    $image = '<div class="zn_full_image"><a data-rel="prettyPhoto" href="' . $feature_image . '" class="hoverBorder"><img class="shadow" src="' . $image['url'] . '" alt=""/></a></div>';
                } else {
                    $image = vt_resize('', $f_image, 280, 187, true);
                    $image = '<a href="' . get_permalink() . '" class="hoverBorder pull-left" style="margin-right: 20px;margin-bottom:4px;"><img class="shadow" src="' . $image['url'] . '" alt=""/></a>';
                }
            }
        }
        ?>
					
					<div class="itemContainer post-<?php 
Example #2
0
/**
 * Adds a post thumbnail and if one doesn't exist the first image from the post is used.
 */
function mantra_set_featured_thumb()
{
    global $mantra_options;
    foreach ($mantra_options as $key => $value) {
        ${"{$key}"} = $value;
    }
    global $post;
    $image_src = echo_first_image($post->ID);
    if (function_exists("has_post_thumbnail") && has_post_thumbnail() && $mantra_fpost == 'Enable') {
        the_post_thumbnail('custom', array("class" => "align" . strtolower($mantra_falign) . " post_thumbnail"));
    } else {
        if ($mantra_fpost == 'Enable' && $mantra_fauto == "Enable" && $image_src && ($mantra_excerptarchive != "Full Post" || $mantra_excerpthome != "Full Post")) {
            echo '<a title="' . the_title_attribute('echo=0') . '" href="' . get_permalink() . '" ><img   width=' . $mantra_fwidth . ' height=' . $mantra_fheight . ' title="" alt="" class="align' . strtolower($mantra_falign) . ' post_thumbnail" src="' . $image_src . '"></a>';
        }
    }
}
Example #3
0
					<div id="top_posts_container" class="container container_2 clearfix">
						<h3><span>Popular Posts</span></h3>
						<?php 
    while (have_posts()) {
        the_post();
        $count++;
        ?>
		
						<div class="top_posts_story container container_2 clearfix">
							<div class='top_posts_image grid_1' style="width: 30%;">
								<a href="<?php 
        the_permalink();
        ?>
" class="clearfix">
								<?php 
        echo_first_image(get_the_ID(), 90);
        ?>
								</a>
							</div>
							<div class='grid_1' style="width: 70%;">
								<div class="top_posts_teaser">
									<p><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="<?php 
        the_title();
        ?>
"><?php 
        the_title();
        ?>
</a></p>
Example #4
0
	$attachments = get_children( $args );

	if ( $attachments ){
		foreach ( $attachments as $attachment ) {
			$image_attributes = wp_get_attachment_image_src( $attachment->ID, 'thumbnail' )
				? wp_get_attachment_image_src( $attachment->ID, 'thumbnail' )
				: wp_get_attachment_image_src( $attachment->ID, 'full');
			echo '<img src="'. wp_get_attachment_thumb_url( $attachment->ID ) . '"class="current">';
		}
	}
}
$ID = 493;

echo "echo_first_image( $ID );";
echo_first_image( $ID );

echo "echo_wp_get_attachment_link( $ID )";
echo wp_get_attachment_link( $ID );

echo "<br/>";

$IDs = [
	517, 515, 516, 514, 513, 512, 509, 510, 511, 506, 507,
	508, 503, 504, 505, 500, 501, 502, 496, 497, 498, 499,
	495, 493, 494, 490, 491, 492, 487, 488, 489, 484, 485,
	486, 481, 482, 483, 478, 479, 480, 475, 476, 477, 472,
	473, 474, 469, 470, 471, 466, 467, 468, 463, 464, 465,
	459, 460, 461, 462, 456, 457, 458
];
Example #5
0
echo $reverse;
?>
" itemscope itemtype="http://schema.org/Article">
   <a href="<?php 
the_permalink();
?>
" <?php 
echo $format_container_class;
?>
>

     <?php 
if (has_post_thumbnail()) {
    the_post_thumbnail('thumbnail', array('itemprop' => 'image'));
} else {
    echo_first_image($post->ID);
}
?>
   <?php 
echo $format_span;
?>
   </a>
    <div class="article_big_content">
        <div class="article_big_info">


            <div class="article_big_category"><a href="<?php 
echo esc_url($category_link);
?>
" itemprop="articleSection"><?php 
echo $firstCategory;
Example #6
0
						<h3><span class="midline">You Might Like:</span></h3>
						<div id="we_also_recommend_stories" class="clearfix">					
								<?php 
        while ($my_query->have_posts()) {
            $my_query->the_post();
            ?>
							<div class="we_also_recommend_story">
								<div class="story_image">
									<a href="<?php 
            the_permalink();
            ?>
" rel="bookmark" title="Permanent Link to <?php 
            the_title_attribute();
            ?>
"><?php 
            echo_first_image(get_the_ID(), 132);
            ?>
</a>
								</div>
								<div class="story_title">
									<a href="<?php 
            the_permalink();
            ?>
" rel="bookmark" title="Permanent Link to <?php 
            the_title_attribute();
            ?>
"><?php 
            the_title();
            ?>
</a>
								</div>