Exemplo n.º 1
0
}
?>
 	   </div>
       
	<div class="entry-meta meta-top">
    	<div class="post-categories">
			<?php 
the_category(' / ', 'single');
?>
		</div>
		<?php 
if ('post' == get_post_type()) {
    ?>
		<div class="entry-meta">
			<?php 
    cwp_megar_posted_on();
    ?>
		</div><!-- .entry-meta -->
		<?php 
}
?>
	
	</div>
	<h2 class="entry-title"><a href="<?php 
the_permalink();
?>
" rel="bookmark"><?php 
the_title();
?>
</a></h2>
    </header><!-- .entry-header -->
Exemplo n.º 2
0
function cwp_loop_callback()
{
    global $post;
    $numPosts = isset($_GET['numPosts']) ? $_GET['numPosts'] : 0;
    $page = isset($_GET['pageNumber']) ? $_GET['pageNumber'] : 0;
    $catt = isset($_GET['catNumber']) ? $_GET['catNumber'] : -1;
    $yearr = isset($_GET['yearPar']) ? $_GET['yearPar'] : -1;
    $monthh = isset($_GET['monthPar']) ? $_GET['monthPar'] : -1;
    $authorr = isset($_GET['authorPar']) ? $_GET['authorPar'] : -1;
    $tagg = isset($_GET['tagPar']) ? $_GET['tagPar'] : -1;
    if ($catt != -1) {
        query_posts(array('posts_per_page' => $numPosts, 'paged' => $page, 'cat' => $catt, 'post_status' => 'publish', 'post__not_in' => get_option('sticky_posts')));
    } elseif ($yearr != -1 && $monthh != -1) {
        query_posts(array('posts_per_page' => $numPosts, 'paged' => $page, 'year' => $yearr, 'monthnum' => $monthh, 'post_status' => 'publish', 'post__not_in' => get_option('sticky_posts')));
    } elseif ($yearr != -1) {
        query_posts(array('posts_per_page' => $numPosts, 'paged' => $page, 'year' => $yearr, 'post_status' => 'publish', 'post__not_in' => get_option('sticky_posts')));
    } elseif ($authorr != -1) {
        query_posts(array('posts_per_page' => $numPosts, 'paged' => $page, 'author_name' => $authorr, 'post_status' => 'publish', 'post__not_in' => get_option('sticky_posts')));
    } elseif ($tagg != -1) {
        query_posts(array('posts_per_page' => $numPosts, 'paged' => $page, 'tag' => $tagg, 'post_status' => 'publish', 'post__not_in' => get_option('sticky_posts')));
    } else {
        query_posts(array('posts_per_page' => $numPosts, 'paged' => $page, 'post_status' => 'publish', 'post__not_in' => get_option('sticky_posts')));
    }
    $cpage = $page;
    while (have_posts()) {
        the_post();
        ?>
       
       
       

		<article id="post-<?php 
        the_ID();
        ?>
" <?php 
        post_class();
        ?>
>
			<header class="entry-header">

				<div class="entry-thumbnail"> 
				<?php 
        if (has_post_thumbnail()) {
            ?>
						<a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
" rel="bookmark">
						<?php 
            the_post_thumbnail(array(250, 250), array('class' => 'alignleft'));
            ?>
						</a>
					<?php 
        }
        ?>
			   </div>
			   
			<div class="entry-meta meta-top">
				<div class="post-categories">
					<?php 
        the_category(' / ');
        ?>
				</div>
				<?php 
        if ('post' == get_post_type()) {
            ?>
				<div class="entry-meta">
					<?php 
            cwp_megar_posted_on();
            ?>
				</div><!-- .entry-meta -->
				<?php 
        }
        ?>
	
			</div>
			<h2 class="entry-title"><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark"><?php 
        the_title();
        ?>
</a></h2>
			</header><!-- .entry-header -->

			<?php 
        if (is_search()) {
            // Only display Excerpts for Search
            ?>
			<div class="entry-summary">
				<?php 
            the_excerpt();
            ?>
			</div><!-- .entry-summary -->
			<?php 
        } else {
            ?>
			<div class="entry-content">
				<?php 
            the_excerpt();
            ?>
				<?php 
            //the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'cwp-megar' ) );
            ?>
				<?php 
            wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'cwp-megar'), 'after' => '</div>'));
            ?>
			</div><!-- .entry-content -->
			<?php 
        }
        ?>
			
		</article><!-- #post-## -->
       
       
      <?php 
    }
    $all = wp_count_posts();
    $pall = ceil($all->publish / $numPosts);
    if ($cpage < $pall) {
        ?>
				
       
	<?php 
    }
    die;
    // this is required to return a proper result
}