Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <?php
  2. if ( is_page("Home") ) {
  3. if( have_rows('slider') ): ?>
  4. <div class="my-slider"><ul >
  5. <?php
  6. // loop through the rows of data
  7. while ( have_rows('slider') ) : the_row();
  8.  
  9. // display a sub field value
  10. $image=get_sub_field('image');
  11. $title= get_sub_field('title');
  12. $byline= get_sub_field('byline');
  13. $link= get_sub_field('link');
  14.  
  15.  
  16. ?>
  17. <li>
  18. <div style="background-image: url(<?php echo $image; ?>); min-height: 600px; background-repeat: no-repeat; background-size: cover">
  19.  
  20. <h2><?php echo $title; ?></h2>
  21. </h3><?php echo $byline; ?><h3>
  22. <a href="<?php echo $link ?>"></a>
  23.  
  24. </li>
  25.  
  26.  
  27. <?php endwhile ?>
  28. </div>
  29. <?php
  30. else :
  31. // no rows found ?>
  32. <?php
  33. endif;
  34. } else {
  35. // This is not the blog posts index
  36.  
  37. }
  38. ?>
  39. <div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement