mizner
2/24/2017 - 7:24 PM

Testimonials

Testimonials

<?php
$the_query = new WP_Query( [
	'post_type'      => 'testimonial',
	'posts_per_page' => 4,
] ); ?>
<?php if ( $the_query->have_posts() ): ?>
    <section class="testimonials-container">
        <div class="container">
            <div class="box">
                <header>
                    <h3><?php the_field( 'testimonials_title' ) ?></h3>
					<?php the_field( 'testimonials_sub_title' ) ?>
                </header>
                <div class="testimonials">
					<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
                        <article>
                            <div class="testimonial-inner">
                                <div class="icon-wrapper">
                                    <i class="fa fa-quote-right" aria-hidden="true"></i>
                                </div>
                                <a href="<?php the_permalink(); ?>">
									<?php the_content(); ?>
                                    <h4><?php the_title(); ?></h4>
                                </a>
                            </div>
                        </article>
					<?php endwhile; ?>
                </div>
            </div>
			<?php if ( get_field( 'testimonials_button_link' ) ): ?>
                <a href="<?php the_field( 'testimonials_button_link' ); ?>">
                    <button class="button"><?php the_field( 'testimonials_button_text' ); ?></button>
                </a>
			<?php endif; ?>
        </div>
    </section>
	<?php wp_reset_postdata(); ?>
<?php endif; ?>
{
    "key": "group_58936c2b07594",
    "title": "Testimonials",
    "fields": [
        {
            "default_value": "",
            "maxlength": "",
            "placeholder": "",
            "prepend": "",
            "append": "",
            "key": "field_58936c2b0c559",
            "label": "Title",
            "name": "testimonials_title",
            "type": "text",
            "instructions": "",
            "required": 0,
            "conditional_logic": 0,
            "wrapper": {
                "width": "",
                "class": "",
                "id": ""
            }
        },
        {
            "default_value": "",
            "new_lines": "",
            "maxlength": "",
            "placeholder": "",
            "rows": "",
            "key": "field_589c862058568",
            "label": "Sub Title",
            "name": "testimonials_sub_title",
            "type": "textarea",
            "instructions": "",
            "required": 0,
            "conditional_logic": 0,
            "wrapper": {
                "width": "",
                "class": "",
                "id": ""
            }
        },
        {
            "default_value": "",
            "maxlength": "",
            "placeholder": "",
            "prepend": "",
            "append": "",
            "key": "field_58936c2b0c613",
            "label": "Button Text",
            "name": "testimonials_button_text",
            "type": "text",
            "instructions": "",
            "required": 0,
            "conditional_logic": 0,
            "wrapper": {
                "width": "",
                "class": "",
                "id": ""
            }
        },
        {
            "post_type": [],
            "taxonomy": [],
            "allow_null": 0,
            "multiple": 0,
            "allow_archives": 1,
            "key": "field_58936c2b0c681",
            "label": "Button Link",
            "name": "testimonials_button_link",
            "type": "page_link",
            "instructions": "",
            "required": 0,
            "conditional_logic": 0,
            "wrapper": {
                "width": "",
                "class": "",
                "id": ""
            }
        }
    ],
    "location": [
        [
            {
                "param": "page_type",
                "operator": "==",
                "value": "front_page"
            }
        ]
    ],
    "menu_order": 5,
    "position": "acf_after_title",
    "style": "default",
    "label_placement": "left",
    "instruction_placement": "label",
    "hide_on_screen": [
        "the_content",
        "featured_image"
    ],
    "active": 1,
    "description": "",
    "modified": 1486652975
}
.testimonials-container {
  background: $gray-dark;
  header {
    text-align: center;
    h3 {
      color: white;
    }
    color: white;
    border-bottom: 1px dotted;
    padding-bottom: 1em;
    margin-bottom: 2em;
  }
  .testimonials {
    display: flex;
    justify-content: space-between;
    flex-flow: row wrap;
    article {
      flex: 1 100%;
      @media screen and (min-width: $medium) {
        flex: 1;
        padding-right: 3em;
        &:last-of-type {
          padding-right: 0;
        }
      }
      margin-bottom: 1em;
      .testimonial-inner {
        p {
          font-size: .9em;
          line-height: 1.2em;
          color: $dark;
        }
        background: white;
        padding: 1em;
        display: flex;
        flex-flow: row wrap;
        .icon-wrapper {
          margin-top: 1em;
          margin-bottom: 1em;
          display: flex;
          justify-content: center;
          i {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 150px;
            height: 150px;
            border-radius: 150px;
            font-size: 6em;
            color: white;
          }
        }
        > * {
          flex: 1 100%;
        }
      }
    }
  }
}