archive.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php get_header() ?>
  2. <!-- https://codex.wordpress.org/Custom_Headers -->
  3. <img class="img-responsive" src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />
  4. <div class="conteudo">
  5. <main>
  6. <section class="meio">
  7. <div class="container">
  8. <div class="row">
  9. <div class="noticias col-md-9">
  10. <?php
  11. the_archive_title('<h1 class="titulo-arquivo">','</h1>');
  12. the_archive_description();
  13. // se tiver algum post publicado, executar
  14. if(have_posts()) :
  15. /// enquanto houver algum post, chame o post de determinada maneira
  16. while (have_posts()) : the_post();
  17. ?>
  18. <!-- funcao que funciona como um include do php -->
  19. <?php get_template_part('content', 'archive'); ?>
  20. <!-- get_template_part('content', 'pagina' - se tiver um aquivo content-pagina ira ser chamado -->
  21. <?php
  22. endwhile;
  23. ?>
  24. <div class="paginacao text-left">
  25. <?php next_posts_link('<< Mais Antigos'); ?>
  26. </div>
  27. <div class="paginacao text-right">
  28. <?php previous_posts_link('Mais Novos >>'); ?>
  29. </div>
  30. <?php
  31. else:
  32. ?>
  33. <p>Não tem nada ainda pra mostrar</p>
  34. <?php
  35. endif;
  36. ?>
  37. </div>
  38. <aside class="barra-lateral col-md-3">
  39. <?php get_sidebar('blog');?>
  40. </aside>
  41. </div>
  42. </div>
  43. </section>
  44. </main>
  45. </div>
  46. <?php get_footer() ?>