Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.73 KB | None | 0 0
  1. <section class="container">
  2.   <h1 class="display-4 text-center mt-4">Day by Day</h1>
  3.  
  4. <div class="card-deck mt-5">
  5.  
  6. <?php
  7.  
  8. $args = array(
  9. 'post_type' => 'film',
  10. 'posts_per_page' => 8
  11. );
  12.  
  13. // La Query
  14. $aap_the_query = new WP_Query( $args  );
  15.  
  16. // Il Loop
  17. while ( $aap_the_query->have_posts() ) :
  18. $aap_the_query->the_post();?>
  19.  
  20.  
  21.  
  22. <div class="card card-news">
  23.     <?php the_post_thumbnail('aap_locandina', array('class' => 'img-fluid mb-4', 'alt' => get_the_title()));?>
  24.     <div class="card-body">
  25.       <h5 class="card-title"><?php the_title();?></h5>
  26.  
  27.  
  28. //Ho sostituito questa parte, il link page di ACF con il link di ACF
  29.       <p class="card-text"><a href="<?php the_field('link_rassegna'); ?>"><?php the_field('link_rassegna'); ?></a></p>
  30. //Quindi il codice preso direttamente dal doc
  31.  
  32.     <?php
  33.       $link = get_field('link_rassegna');
  34.       if( $link ):
  35.           $link_url = $link['url'];
  36.           $link_title = $link['title'];
  37.           $link_target = $link['target'] ? $link['target'] : '_self';
  38.           ?>
  39.           <p class="card-text"><a class="" href="<?php echo esc_url( $link_url ); ?>" target="<?php echo esc_attr( $link_target ); ?>"><?php echo esc_html( $link_title ); ?></a></p>
  40.       <?php endif; ?>
  41.  
  42. //in questo modo il title della pagina viene visualizzato
  43.  
  44.       <p class="card-text"><a href="<?php the_field('link_luogo'); ?>"><?php the_field('link_luogo'); ?></a></p>
  45.       <p class="card-text"><i class="far fa-calendar-check"></i> <?php the_field('data'); ?></p>
  46.       <p class="card-text"><i class="far fa-clock"></i> <?php the_field('ora'); ?></p>
  47.   </div>
  48. </div>
  49.  
  50.  
  51.  
  52.  
  53. <?php endwhile;
  54. // Ripristina Query & Post Data originali
  55. wp_reset_query();
  56. wp_reset_postdata();  ?>
  57. </div>
  58. </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement