Last active
August 29, 2015 14:00
-
-
Save rslonik/11262213 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Code for custom loop */ | |
function my_custom_loop() { | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
// WP_Query arguments | |
$args = array ( | |
'post_type' => 'any', | |
'category_name' => 'hall-dos-aprovados', | |
'pagination' => true, | |
'paged' => $paged, | |
'posts_per_page' => '10', | |
); | |
// The Query | |
$wp_query = new WP_Query( $args ); | |
// The Loop | |
if ( $wp_query->have_posts() ) { ?> | |
<div class="archive-description taxonomy-description"><h1 class="archive-title">Hall dos aprovados</h1><p>Foi aprovado e quer deixar também seu depoimento? <a href="http://www.aprovaconcursos.com.br/noticias/hall-dos-aprovados/eu-fui-aprovado/">Clique aqui</a>.</p> | |
</div> | |
<?php while ( $wp_query->have_posts() ) { | |
$wp_query->the_post(); | |
?> | |
<div class="post type-post status-publish format-standard hentry category-hall-dos-aprovados entry"> | |
<?php if('aprovados' == get_post_type()) { | |
echo '<a href="'.get_permalink().'"><h2 class="entry-title">'.get_post_meta( get_the_ID(), 'post_title', true ).' passou no concurso '.get_post_meta( get_the_ID(), 'post_concurso', true ).'</h2></a>'; | |
} else { ?> | |
<h2 class="entry-title"><a href="<?php the_permalink();?>" title="<?php the_title();?>”" rel="bookmark"><?php the_title();?></a></h2> | |
<?php } ?> | |
<div class="post-info"> | |
<span class="date published time" title="<?php the_date(); ?>"><?php echo get_the_date('d-m-Y'); ?></span> por <?php the_author_posts_link(); ?> <a href="<?php comments_link(); ?>">Deixar um Comentário</a> <?php edit_post_link('Editar','(',')'); ?></div> | |
<div class="entry-content"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> | |
<img width="250" height="80" src="http://wp.aprovaconcursos.com.br/noticias/wp-content/uploads/2014/04/Eu-fui-aprovado-2501-250x80.jpg" class="alignleft post-image entry-image" alt="Eu-fui-aprovado-250" itemprop="image"></a> | |
<p><?php the_excerpt(); ?> </p> | |
</div></div> | |
<?php | |
} | |
?><ul> | |
<li><?php previous_posts_link( '« PREV', $wp_query->max_num_pages) ?></li> | |
<li><?php next_posts_link( 'NEXT »', $wp_query->max_num_pages) ?></li> | |
</ul><?php | |
} else { | |
echo ' no posts found'; | |
} | |
echo 'oi'; ?> | |
<?php | |
// Restore original Post Data | |
wp_reset_postdata(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment