Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <div id="content" class="col">
- <?php if (have_posts()) : ?>
- <?php while (have_posts()) : the_post(); ?>
- <div class="col last">
- <h2><?php the_title(); ?></h2>
- <?php edit_post_link('Editar','<div class="meta_pesquisa">','</div>'); ?>
- <?php the_content('Continue reading...'); ?>
- <?php $lista_categorias= get_post_meta($post->ID,'categorias',true);
- If ($lista_categorias) {
- $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- $myposts = get_posts("cat=$lista_categorias&showposts=10&paged=$paged");
- foreach($myposts as $post) :
- setup_postdata($post);
- $ano = get_the_time('Y');
- insere_ano_pesquisa($ano);
- ?>
- <h2 class="pesquisas"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
- <div class="meta_pesquisa">
- <?php
- the_time('F Y');
- echo ' | ';
- the_tags();?>
- </div>
- <?php
- the_excerpt();?>
- <p><a href="<?php the_permalink(); ?>">Ver mais detalhes</a></p>
- <?php
- endforeach;
- }
- ?>
- </div>
- <?php endwhile; ?>
- <?php else : ?>
- <h3>Page Not Found</h3>
- <p>Sorry, but you are looking for something that isn't here.</p>
- <?php endif; ?>
- </div>
- <hr />
- <?php // get_sidebar(); ?>
- <?php get_footer(); ?>
- //ATENÇÃO! COLAR O CÓDIGO ABAIXO NO ARQUIVO FUNCTIONS.PHP DO SEU TEMA
- <?php
- function insere_ano_pesquisa($ano){
- global $post, $anoanterior;
- If ($ano!==$anoanterior) {
- echo '<h2 class="ano">'.$ano.'</h2>';
- }
- $anoanterior=$ano;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement