Ejemplo n.º 1
0
            the_ID();
            ?>
',
										nextId: 'post_thumb_next<?php 
            the_ID();
            ?>
',
									});
								});
							</script>

						<?php 
        } else {
            ?>
							<?php 
            post_thumbnail(668, 288);
            ?>
						<?php 
        }
        ?>
					</div>

					<div class="entry">
						<p><?php 
        echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 300, "......");
        ?>
</p>
					</div>
					<div class="read_more">
						<a href="<?php 
        the_permalink();
Ejemplo n.º 2
0
			<div id="rc_post_bd3" class="box_bd">
				<ul class="clearfix">
					<?php 
    while (have_posts()) {
        the_post();
        ?>
					<li>
						<div class="post_title">
							<h2><?php 
        the_title();
        ?>
</h2>
						</div>
						<div class="post_img">
							<?php 
        post_thumbnail(215, 215);
        ?>
						</div>

						<div class="post_mask png"></div>
						<div class="post_link"><a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title();
        ?>
">阅读全文</a></div>
					</li>
					<?php 
    }
    ?>
Ejemplo n.º 3
0
        ?>
>

	

	<!-- post thumbnail -->
	
			<a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title();
        ?>
">
				<?php 
        echo post_thumbnail('150', '150');
        // Declare pixel size you need inside the array
        ?>
			</a>
	
		<!-- /post thumbnail -->
	

		<!-- post title -->
		<h2>
			<a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title();
        ?>
Ejemplo n.º 4
0
    function widget($args, $instance)
    {
        extract($args);
        ?>

<?php 
        echo $before_widget;
        ?>

<h3 class="widget-title"><?php 
        echo $instance['title'];
        ?>
</h3>
<div class="widget-line"></div>
<ul class="catPost">
<?php 
        $post_tags = wp_get_post_tags($post->ID);
        if ($post_tags) {
            foreach ($post_tags as $tag) {
                // 获取标签列表
                $tag_list[] .= $tag->term_id;
            }
        }
        $post_tag = $tag_list[rand(0, count($tag_list) - 1)];
        $query_posts = new WP_Query('orderby=rand&caller_get_posts=1&showposts=' . $instance['Num'] . '&tag_in=' . $post_tag);
        ?>

<?php 
        while ($query_posts->have_posts()) {
            $query_posts->the_post();
            ?>

<?php 
            if ($instance['style'] == "img") {
                ?>

<li class="imglist"><a href=" <?php 
                the_permalink();
                ?>
 " title=" <?php 
                the_title();
                ?>
 ">
    <?php 
                if (dopt('Rcloud_timthumb_b')) {
                    post_thumbnail(145, 90);
                } else {
                    the_img();
                }
                ?>

<?php 
                the_title();
                ?>
 </a></li>
<?php 
            } elseif ($instance['style'] == "text") {
                ?>

<li class="textlist"><a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title();
                ?>
"><?php 
                the_title();
                ?>
</a></li>
<?php 
            }
        }
        ?>

</ul>
              <?php 
        echo $after_widget;
        ?>

        <?php 
    }
Ejemplo n.º 5
0
    /**
     * Front-end display of widget.
     *
     * @see WP_Widget::widget()
     *
     * @param array $args     Widget arguments.
     * @param array $instance Saved values from database.
     */
    public function widget($args, $instance)
    {
        extract($args);
        $before_widget = '<section class="box featured">';
        $before_title = '<h3>';
        $after_title = '</h3>';
        $after_widget = '</section>';
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Featured project') : $instance['title'], $instance, $this->id_base);
        if (empty($instance['length']) || !($length = absint($instance['length']))) {
            $length = 20;
        }
        $posts = new WP_Query(array('cat' => $instance['category'], 'orderby' => 'date'));
        if ($posts->have_posts()) {
            ?>
		<?php 
            echo $before_widget;
            ?>
		<?php 
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
		<!-- first-posts -->
		<?php 
            while ($posts->have_posts()) {
                $posts->the_post();
                ?>
                    <figure class="photo">
                        <?php 
                post_thumbnail(220, 160);
                ?>
                    </figure>
                    <h4><?php 
                echo get_title_excerpt(0);
                ?>
</h4>
                    <p><?php 
                echo get_post_excerpt($length, '');
                break;
                ?>
</p>
                    
		<?php 
            }
            ?>
		<?php 
            echo $after_widget;
            // Reset the global $the_post as this query will have stomped on it
            wp_reset_postdata();
        }
    }
Ejemplo n.º 6
0
        	 
		<?php 
$categoryID = $cat;
$wp_query = new WP_Query('cat=' . $categoryID . 'orderby=date&order=desc&posts_per_page=' . $postsperpage . '&paged=' . $paged);
?>
		<?php 
while (have_posts()) {
    the_post();
    ?>
		<ul class="products">
			<li>
			<a href="<?php 
    the_permalink();
    ?>
"><?php 
    post_thumbnail();
    ?>
</a>
			<br /><p><a href="<?php 
    the_permalink();
    ?>
"><?php 
    the_title();
    ?>
</a></p>
			</li>
		</ul>
		<?php 
}
?>
		</div>
Ejemplo n.º 7
0
Archivo: widget.php Proyecto: h2y/germ
function mzw_posts_list($orderby, $limit, $cat)
{
    $args = array('order' => DESC, 'cat' => $cat, 'orderby' => $orderby, 'showposts' => $limit, 'caller_get_posts' => 1);
    query_posts($args);
    echo '<div class="smart_post"><ul>';
    while (have_posts()) {
        the_post();
        global $post;
        echo '<li class="clearfix">';
        echo '<div class="post-thumb">';
        echo post_thumbnail(45, 45, false);
        echo '</div>';
        echo '<div class="post-right">';
        echo '<h3><a href="' . get_permalink() . '">';
        the_title();
        echo '</a></h3><div class="post-meta"><span>';
        comments_popup_link('暂无评论', '1 条评论', '% 条评论');
        echo '</span> | <span>';
        mzw_post_views(' 访问量');
        echo '</span></div></div>';
        echo '</li>';
    }
    wp_reset_query();
    echo '</ul></div>';
}
Ejemplo n.º 8
0
        // loop over query
        if ($related_items->have_posts()) {
            echo '<h3 class="related">相关产品</h3>';
            echo '<ul class="row clearfix">';
            while ($related_items->have_posts()) {
                $related_items->the_post();
                ?>
    <li class="gird-1-4">
    	<a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title_attribute();
                ?>
"><?php 
                echo post_thumbnail('110', '90');
                ?>
</a>
    </li>
<?php 
            }
            echo '</ul>';
        }
        // Reset Post Data
        wp_reset_postdata();
        ?>
		</article>
		<!-- /article -->

	<?php 
    }
Ejemplo n.º 9
0
"><?php 
    }
    if ($ifpic != 'checked') {
        ?>
	<?php 
        if (has_post_thumbnail()) {
            ?>
    <?php 
            post_thumbnail($imgW, $imgH, lateLoad('data-') . 'src');
            if (has_excerpt()) {
                the_excerpt();
            } else {
                echo dm_strimwidth(strip_tags($post->post_content), 0, $dis_num, '....');
            }
        } elseif (catch_that_image()) {
            post_thumbnail($imgW, $imgH, lateLoad('data-') . 'src');
            ?>
		<?php 
            if (has_excerpt()) {
                the_excerpt();
            } else {
                echo dm_strimwidth(strip_tags($post->post_content), 0, $dis_num, '....');
            }
        } else {
            if (has_excerpt()) {
                the_excerpt();
            } else {
                echo dm_strimwidth(strip_tags($post->post_content), 0, $dis_num + 50, '....');
            }
        }
    }
Ejemplo n.º 10
0
function ajax_paged()
{
    if (isset($_GET['action']) && $_GET['action'] == 'ajax_paged') {
        $paged_num = $_GET['paged'];
        query_posts($query_string . '&posts_per_page=8&paged=' . $paged_num);
        ?>
		<?php 
        if (have_posts()) {
            ?>
			<div id="rc_post_hd" class="box_hd">
				<div id="rc_post_title" class="box_fl">
					<i></i><strong>最新文章</strong>
				</div>
				<div id="rc_post_cat" class="box_fr">
					<ul>
						<li><a title="<?php 
            bloginfo('name');
            ?>
" href="<?php 
            bloginfo('url');
            ?>
" class="current all">全部</a></li>
						<?php 
            wp_list_categories('title_li=&hierarchical=1&depth=1&hide_empty=0&include=118,90,132');
            ?>
					</ul>
				</div>
			</div>
			<div id="rc_post_bd" class="box_bd">
				<ul class="clearfix">
					<?php 
            while (have_posts()) {
                the_post();
                ?>
					<li>
						<div class="post_title">
							<h2><?php 
                the_title();
                ?>
</h2>
						</div>
						<div class="post_img">
							<?php 
                post_thumbnail(215, 215);
                ?>
						</div>
						<div class="post_more">
							<a href="javascript:;" class="png"></a>
						</div>
						<div class="post_mask png"></div>
						<div class="post_link"><a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title();
                ?>
">阅读全文</a></div>
					</li>
					<?php 
            }
            ?>
				</ul>
			</div>
			
			<!-- S Pagenavi -->
			<?php 
            pagenavi();
            ?>
			<!-- E Pagenavi -->
		<?php 
        }
        ?>
	<?php 
        die;
    } else {
        return;
    }
}
Ejemplo n.º 11
0
    ?>
        <div class="entry-summary">
            <?php 
    the_excerpt();
    ?>
        </div><!-- .entry-summary -->
    <?php 
} else {
    ?>
        <figure class="visual">
            <?php 
    if (has_post_thumbnail($post_id)) {
        ?>
  
                <?php 
        post_thumbnail(615, 284);
        ?>
  
            <?php 
    }
    ?>
  
        </figure>
        <p>
            <?php 
    echo get_post_excerpt(55, '');
    ?>
        </p>
        <a href="<?php 
    echo get_permalink();
    ?>
Ejemplo n.º 12
0
		<ul class="index-pro row">
				   <?php 
$args = array('post_type' => 'product', 'showposts' => 4);
$my_query = new WP_Query($args);
if ($my_query->have_posts()) {
    while ($my_query->have_posts()) {
        $my_query->the_post();
        ?>

				
					<li class="grid-1-4 col-1-2">
						<a href="<?php 
        the_permalink();
        ?>
"><?php 
        echo post_thumbnail('200', '200');
        ?>
</a>
						<h3><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
					</li>
					 <?php 
    }
    wp_reset_query();
}
?>