function ss_gallery_slideshow()
{
    ?>

<?php 
    require_once 'enqueue.php';
    $ss = 'slideshow_gallery';
    $repeat_slider_img = 'repeat_slider_img_gallery';
    $slider_img_img = 'slider_img_gallery';
    $options = false;
    $testimonial_text = get_sub_field('testimonial_text');
    ?>

<section class="portrait_slideshow">

  <div class="slider_img cycle-slideshow" 
      data-cycle-fx="fadeout" 
      data-cycle-swipe=true
      data-cycle-swipe-fx=scrollHorz
      data-cycle-timeout="3000"
      data-cycle-delay="-300"
      data-index=3
      data-cycle-pager-template="<span class = 'icon pager-icon'></span>"
      data-cycle-center-horz=true
      data-cycle-center-vert=true
      data-cycle-slides="> .slide"
      >
	<div class="cycle-pager"></div>
   <div class="cycle-prev"></div>
      <div class="cycle-next"></div>
	<?php 
    if (have_rows($repeat_slider_img, $options)) {
        while (have_rows($repeat_slider_img, $options)) {
            the_row();
            ?>
  
    <div class = "slide">
	<?php 
            gisf($slider_img_img, 'ml_gallery_slider');
            ?>
    </div><!--slide-->
  
    <?php 
        }
    }
    ?>
  
  </div>

</section>

<?php 
}
function acf_gallery()
{
    //this is the gallery slideshow on trisled and single hpv page, grayjohnson inspired gallery
    //call the funtion with this
    //acf_gallery();
    //this function is not an add component as its to specific and wp already has a gallery
    ?>

  <?php 
    enqueue_jquery_cycle2_js_css();
    ?>

      <section class = "gallery">

	  <article class="content">

	    <div class = "container">
  
<?php 
    $gal = 'acf_gallery';
    if (have_rows($gal)) {
        ?>

  <div id = "slideshow" class = "pics">

  <?php 
        while (have_rows($gal)) {
            the_row();
            ?>
	  
  <?php 
            gisf('gallery_img', 'ml_gallery_hero', false);
            ?>
    
  <?php 
        }
        ?>
 

  </div>

<?php 
    } else {
        // no rows found
    }
    if (have_rows($gal)) {
        ?>

  <ul class = "slideshow_nav" id = "nav">

    <?php 
        while (have_rows($gal)) {
            the_row();
            ?>

  <li>

    <a href = "#">

      <?php 
            gisf('gallery_img', 'ml_thumb_size', false);
            ?>

    </a>

  </li>

<?php 
        }
        ?>
 

    </ul>

<?php 
    } else {
        // no rows found
    }
    ?>


  
	</div>
	
	  </article>

      </section>

<?php 
}
Example #3
0
function acf_content_blocks($options = '')
{
    $aside_textarea = get_sub_field('aside_textarea_cb');
    $has_sidebar = get_sub_field('has_sidebar_cb');
    //equal to true false
    $unique_class = get_sub_field('style_choice');
    echo '<section class =';
    if ($has_sidebar) {
        echo '"grid with_sidebar ' . $unique_class . '"';
    } else {
        echo '"grid ' . $unique_class . '"';
    }
    echo '>';
    //close section;
    if (have_rows("acf_content_block")) {
        ?>

      <article class="content">

	<?php 
        while (have_rows("acf_content_block")) {
            the_row();
            //MUST SET VARIABLES INSIDE LOOP FOR SCOOPING
            //USE GET_SUB_FIELD TO STORE AS VARIABLE
            $link_to_post = get_sub_field('link_to_full_post');
            //qual to string
            $block_content = get_sub_field('block_content');
            //qual to string
            $block_title = get_sub_field('block_title');
            //qual to string
            $link_lable = get_sub_field('link_to_full_post_label');
            //qual to string
            switch ($link_to_post) {
                case true:
                    if ($unique_class == 'staggered') {
                        //DISPLAY TITLE OUTSIDE OF CELL
                        echo '<h2><a href="' . $link_to_post . '">' . $block_title . '</a></h2><div class = "cell">';
                    } else {
                        //DISPLAY TITLE IN THE CELL
                        echo '<div class = "cell"><h2><a href="' . $link_to_post . '">' . $block_title . '</a></h2>';
                    }
                    //not staggered
                    //SET THE IMAGE SIZE BASED ON COL AMOUNT
                    if ($unique_class == 'c3') {
                        gisf('block_image', '3_col_thumb');
                    } elseif ($unique_class == 'c2') {
                        gisf('block_image', '2_col_thumb');
                    } elseif ($unique_class == 'c4') {
                        gisf('block_image', '4_col_thumb');
                    } elseif ($unique_class == 'staggered') {
                        gisf('block_image', 'staggered');
                    } elseif ($unique_class == 'before_after') {
                        gisf('block_image', 'before_after');
                    }
                    echo $block_content;
                    ?>

      <span>

	  <a class = "cta" href=" <?php 
                    echo $link_to_post;
                    ?>
 "><!--a-->

	    <?php 
                    echo $link_lable;
                    ?>

	    <span class = "icon more_icon"></span>
		    
	  </a>

      </span>

    </div> <!--cell end with link-->

    <?php 
                    break;
                case false:
                    if ($unique_class == 'staggered') {
                        //DISPLAY TITLE OUTSIDE OF CELL FOR STAGGERED
                        echo '<h2>' . $block_title . '</h2>' . '<div class = "cell">';
                    } else {
                        //display title in the cell
                        echo '<div class = "cell"><h2>' . $block_title . '</h2>';
                    }
                    //SET THE IMAGE SIZE BASED ON COL AMOUNT
                    if ($unique_class == 'c3') {
                        gisf('block_image', '3_col_thumb');
                    } elseif ($unique_class == 'c2') {
                        gisf('block_image', '2_col_thumb');
                    } elseif ($unique_class == 'c4') {
                        gisf('block_image', '4_col_thumb');
                    } elseif ($unique_class == 'staggered') {
                        gisf('block_image', 'staggered');
                    } elseif ($unique_class == 'before_after') {
                        gisf('block_image', 'before_after');
                    }
                    echo $block_content;
                    ?>

    </div> <!--cell end without link-->

    <?php 
                    break;
            }
        }
        ?>

	</article> <!--content-->
	
	      <!--blog post sidebar-->

      <?php 
        if ($has_sidebar) {
            ?>

		<aside> 

		<?php 
            echo $aside_textarea;
            ?>

		</aside>

      <?php 
        }
        ?>


	</section>

    <?php 
    }
    ?>

  <?php 
}