front-page.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content');
  3. remove_action('genesis_loop', 'genesis_do_loop');
  4. // filtro que troca o p com class site-title para um h1 com site-title
  5. function h1_for_site_title( $wrap ) {
  6. return 'h1';
  7. }
  8. add_filter('genesis_site_title_wrap', 'h1_for_site_title');
  9. add_action('genesis_loop', 'meufilho_home_loop');
  10. function meufilho_home_loop() {
  11. ?>
  12. <div class="home-top">
  13. <div class="sobre">
  14. <h2>Sobre Nós</h2>
  15. <?php dynamic_sidebar('sobre1'); ?>
  16. <?php dynamic_sidebar('sobre2'); ?>
  17. <?php dynamic_sidebar('sobre3'); ?>
  18. </div>
  19. </div>
  20. <div class="home-middle">
  21. <h2>Últimos posts</h2>
  22. <?php
  23. $args = array(
  24. 'post_type' => 'post',
  25. 'posts_per_page' => 3
  26. );
  27. $loop = new WP_Query( $args );
  28. $cont = 1;
  29. if( $loop->have_posts() ) :
  30. while( $loop->have_posts() ):
  31. $loop->the_post();
  32. ?>
  33. <div class="<?php echo ($cont == 1) ? 'one-third first' : 'one-third'; ?>">
  34. <div class="miniatura"><?php the_post_thumbnail(); ?></div>
  35. <div class="titulo"><h3><?php the_title(); ?></h3></div>
  36. <div class="resumo"><?php the_excerpt(); ?></div>
  37. <div class="ler-mais"><a class="ler-mais" href="<?php the_permalink(); ?>">Ler mais</a></div>
  38. </div>
  39. <?php
  40. $cont++;
  41. endwhile;
  42. wp_reset_postdata();
  43. endif;
  44. ?>
  45. </div>
  46. <?php
  47. }
  48. genesis();
  49. ?>