PageRenderTime 53ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/front-page.php

https://gitlab.com/sebastianromero/Portfolio-2015
PHP | 170 lines | 117 code | 39 blank | 14 comment | 9 complexity | cd576019dc841259391233e889c004cc MD5 | raw file
  1. <?php get_header(); ?>
  2. <div class="slider__wrap">
  3. <div class="slider">
  4. <ul class="slides">
  5. <?php
  6. // WP_Query arguments
  7. $sticky = get_option( 'sticky_posts' );
  8. $args = array(
  9. 'posts_per_page' => '-1',
  10. 'post__in' => $sticky
  11. );
  12. // The Query
  13. $portfolio = new WP_Query( $args );
  14. // The Loop
  15. if ( $portfolio->have_posts() ) {
  16. while ( $portfolio->have_posts() ) {
  17. $portfolio->the_post();
  18. ?>
  19. <li class="slider__item" style="background-image:url('<?php miniatura( "full" ); ?>');";">
  20. <a href="<?php the_permalink(); ?>" class="pseudo-link"></a>
  21. <div class="slider__project-info">
  22. <h1><?php the_title(); ?></h1>
  23. </div>
  24. </li>
  25. <?php
  26. }
  27. } else {
  28. }
  29. // Restore original Post Data
  30. wp_reset_postdata();;?>
  31. </ul>
  32. </div>
  33. </div>
  34. <main id="main" class="contenido-principal" role="main">
  35. <section class="portfolio contenedor">
  36. <ul class="grilla-portfolio">
  37. <?php
  38. // WP_Query arguments
  39. $sticky = get_option( 'sticky_posts' );
  40. $args = array(
  41. 'posts_per_page' => '6',
  42. 'ignore_sticky_posts' => 1,
  43. 'post_status' => 'publish',
  44. 'has_password' => false,
  45. // 'post__not_in' => $sticky,
  46. );
  47. // The Query
  48. $portfolio = new WP_Query( $args );
  49. // The Loop
  50. if ( $portfolio->have_posts() ) {
  51. while ( $portfolio->have_posts() ) {
  52. $portfolio->the_post();
  53. ?>
  54. <li class="grilla-portfolio__proyecto">
  55. <article class="proyecto">
  56. <a href="<?php the_permalink(); ?>" class="pseudo-link"></a>
  57. <div class="proyecto__imagen" style="background-image:url('<?php miniatura( 'large' ); ?>');"></div>
  58. <div class="proyecto__datos">
  59. <h1>
  60. <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
  61. </h1>
  62. </div>
  63. </article>
  64. </li>
  65. <?php
  66. }
  67. } else {
  68. // no posts found
  69. }
  70. // Restore original Post Data
  71. wp_reset_postdata();;?>
  72. </ul>
  73. <?php
  74. $id = get_page_by_path( 'portfolio' );
  75. $page = get_page_link( $id );
  76. echo '<p class="todos-los-proyectos"><a href="' . $page . '">Ver todos los proyectos</a></p>';
  77. ?>
  78. </section>
  79. </main><!-- #main -->
  80. <aside class="modulos-sociales">
  81. <div class="contenedor">
  82. <?php
  83. // WP_Query arguments
  84. $args = array(
  85. 'post_type' => 'blog',
  86. 'posts_per_page' => '1',
  87. 'ignore_sticky_posts' => 1,
  88. );
  89. // The Query
  90. $ultimo_post = new WP_Query( $args );
  91. // The Loop
  92. if ( $ultimo_post->have_posts() ) {
  93. while ( $ultimo_post->have_posts() ) {
  94. $ultimo_post->the_post();
  95. ?>
  96. <div class="modulo-social modulo-social--blog">
  97. <div class="modulo-social__imagen" style="background-image:url('<?php miniatura( full ); ?>');"></div>
  98. <div class="modulo-social__contenido modulo-social__contenido--con-fondo">
  99. <h2 class="modulo-social__id">Blog</h2>
  100. <a href="<?php the_permalink(); ?>" class="pseudo-link"></a>
  101. <h1>
  102. <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
  103. </h1>
  104. </div>
  105. </div>
  106. <?php
  107. }
  108. } else {
  109. }
  110. // Restore original Post Data
  111. wp_reset_postdata();;?>
  112. <div class="modulo-social" id="modulo-social--instagram">
  113. <?php $instagram = get_user_meta( 1, 'instagram', true );
  114. echo '<a class="pseudo-link" href="http://www.instagram.com/' . $instagram . '"></a>' ?>
  115. <div id="instagram__imagen"></div>
  116. <div class="modulo-social__contenido modulo-social__contenido--con-fondo">
  117. <h2 class="modulo-social__id">Instagram</h2>
  118. <h1 id="instagram__caption"></h1>
  119. </div>
  120. </div>
  121. <div class="modulo-social modulo-social--twitter" id="modulo-social--twitter">
  122. <?php $twitter = get_user_meta( 1, 'twitter', true );
  123. echo '<a class="pseudo-link" href="http://www.twitter.com/' . $twitter . '"></a>' ?>
  124. <div class="modulo-social__contenido">
  125. <h2 class="modulo-social__id">Twitter</h2>
  126. <div id="twitter__contenido"></div>
  127. </div>
  128. </div>
  129. </div>
  130. </aside>
  131. <?php get_footer(); ?>