Featured Carousel
Signed-off-by: Jeff <jeff@gotenzing.com>
Showing
9 changed files
with
89 additions
and
2 deletions
| ... | @@ -154,6 +154,40 @@ $carousel_style = get_field('carousel_style'); | ... | @@ -154,6 +154,40 @@ $carousel_style = get_field('carousel_style'); |
| 154 | <?php endif; ?> | 154 | <?php endif; ?> |
| 155 | 155 | ||
| 156 | <?php break; | 156 | <?php break; |
| 157 | case 'featured': ?> | ||
| 158 | <?php if( have_rows('promo_items') ): ?> | ||
| 159 | <div class=" carousel-items promo-carousel featured-carousel"> | ||
| 160 | <div class='swiper-wrapper'> | ||
| 161 | <?php while( the_repeater_field('promo_items') ): ?> | ||
| 162 | <?php $page = get_sub_field('featured_post'); ?> | ||
| 163 | <div class="swiper-slide"> | ||
| 164 | <div class="carousel-content"> | ||
| 165 | |||
| 166 | <div class="promo-image" > | ||
| 167 | <?php $image = get_the_post_thumbnail_url( $page->ID, 'medium' ); | ||
| 168 | $thumbnail_id = get_post_meta( $page->ID, '_thumbnail_id', true ); | ||
| 169 | $img_alt = get_post_meta ( $thumbnail_id, '_wp_attachment_image_alt', true ); | ||
| 170 | if(!$img_alt){ | ||
| 171 | $img_alt = get_the_title($thumbnail_id); | ||
| 172 | } | ||
| 173 | ?> | ||
| 174 | <img src="<?php echo $image; ?>" alt="<?php echo $img_alt ?>" loading="eager"> | ||
| 175 | </div> | ||
| 176 | <div class="promo-text"><h2><?php echo get_the_title($page->ID); ?></h2><p><?php echo get_the_excerpt($page->ID); ?></p><a class="understrap-read-more-link" href="<?php echo get_permalink($page->ID);?>"><?= __('READ MORE', 'msf') ?></a></div> | ||
| 177 | |||
| 178 | |||
| 179 | </div> | ||
| 180 | </div> | ||
| 181 | <?php endwhile; ?> | ||
| 182 | </div> | ||
| 183 | <div class="swiper-button-prev" data-id="<?= $id ?>"></div> | ||
| 184 | <div class="swiper-button-next" data-id="<?= $id ?>"></div> | ||
| 185 | </div> | ||
| 186 | <?php else: ?> | ||
| 187 | <p>Please add some slides.</p> | ||
| 188 | <?php endif; ?> | ||
| 189 | |||
| 190 | <?php break; | ||
| 157 | default: ?> | 191 | default: ?> |
| 158 | <p>Please select style.</p> | 192 | <p>Please select style.</p> |
| 159 | <?php }; ?> | 193 | <?php }; ?> | ... | ... |
| ... | @@ -20642,6 +20642,29 @@ ul.sf_date_field .sf-datepicker { | ... | @@ -20642,6 +20642,29 @@ ul.sf_date_field .sf-datepicker { |
| 20642 | background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="65.928" height="65.928" viewBox="0 0 65.928 65.928"><defs><clipPath id="clip-path"><rect id="Rectangle_250" data-name="Rectangle 250" width="65.928" height="65.928" fill="%23fff"/></clipPath></defs><g id="Group_1994" data-name="Group 1994" opacity="0.6"><g id="Group_1914" data-name="Group 1914"><path id="Path_1401" data-name="Path 1401" d="M112.886,81.243,91.2,94.52V67.966Z" transform="translate(-66.167 -48.109)" fill="%23fff"/><g id="Group_1516" data-name="Group 1516"><g id="Group_1515" data-name="Group 1515" clip-path="url(%23clip-path)"><path id="Path_1402" data-name="Path 1402" d="M32.964,65.928A32.964,32.964,0,1,1,65.929,32.964,33,33,0,0,1,32.964,65.928m0-57.886A24.922,24.922,0,1,0,57.887,32.964,24.95,24.95,0,0,0,32.964,8.042" fill="%23fff"/></g></g></g></g></svg>'); | 20642 | background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="65.928" height="65.928" viewBox="0 0 65.928 65.928"><defs><clipPath id="clip-path"><rect id="Rectangle_250" data-name="Rectangle 250" width="65.928" height="65.928" fill="%23fff"/></clipPath></defs><g id="Group_1994" data-name="Group 1994" opacity="0.6"><g id="Group_1914" data-name="Group 1914"><path id="Path_1401" data-name="Path 1401" d="M112.886,81.243,91.2,94.52V67.966Z" transform="translate(-66.167 -48.109)" fill="%23fff"/><g id="Group_1516" data-name="Group 1516"><g id="Group_1515" data-name="Group 1515" clip-path="url(%23clip-path)"><path id="Path_1402" data-name="Path 1402" d="M32.964,65.928A32.964,32.964,0,1,1,65.929,32.964,33,33,0,0,1,32.964,65.928m0-57.886A24.922,24.922,0,1,0,57.887,32.964,24.95,24.95,0,0,0,32.964,8.042" fill="%23fff"/></g></g></g></g></svg>'); |
| 20643 | } | 20643 | } |
| 20644 | 20644 | ||
| 20645 | .featured-carousel { | ||
| 20646 | height: 400px; | ||
| 20647 | } | ||
| 20648 | |||
| 20649 | .carousel:has(.featured-carousel) { | ||
| 20650 | height: 400px; | ||
| 20651 | } | ||
| 20652 | .carousel:has(.featured-carousel) .promo-text h2, .carousel:has(.featured-carousel) .promo-text .h2 { | ||
| 20653 | font-size: 18px; | ||
| 20654 | line-height: 23px; | ||
| 20655 | text-align: left; | ||
| 20656 | } | ||
| 20657 | .carousel:has(.featured-carousel) .promo-text p { | ||
| 20658 | font-size: 1rem; | ||
| 20659 | line-height: 1.5rem; | ||
| 20660 | text-align: left; | ||
| 20661 | } | ||
| 20662 | .carousel:has(.featured-carousel) .understrap-read-more-link { | ||
| 20663 | font-size: 14px; | ||
| 20664 | line-height: 21px; | ||
| 20665 | text-align: left; | ||
| 20666 | } | ||
| 20667 | |||
| 20645 | .pojo-a11y-grayscale { | 20668 | .pojo-a11y-grayscale { |
| 20646 | overflow-y: scroll !important; | 20669 | overflow-y: scroll !important; |
| 20647 | } | 20670 | } | ... | ... |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
| ... | @@ -66,6 +66,7 @@ if( function_exists('acf_add_options_page') ) { | ... | @@ -66,6 +66,7 @@ if( function_exists('acf_add_options_page') ) { |
| 66 | 'customClassName' => true | 66 | 'customClassName' => true |
| 67 | ] | 67 | ] |
| 68 | )); | 68 | )); |
| 69 | |||
| 69 | acf_register_block_type( array( | 70 | acf_register_block_type( array( |
| 70 | 'title' => __( 'Relevant Resources', 'client_textdomain' ), | 71 | 'title' => __( 'Relevant Resources', 'client_textdomain' ), |
| 71 | 'name' => 'relevant-resources', | 72 | 'name' => 'relevant-resources', | ... | ... |
| ... | @@ -256,3 +256,5 @@ if ( ! function_exists( 'understrap_all_excerpts_get_more_link' ) ) { | ... | @@ -256,3 +256,5 @@ if ( ! function_exists( 'understrap_all_excerpts_get_more_link' ) ) { |
| 256 | 256 | ||
| 257 | } | 257 | } |
| 258 | } | 258 | } |
| 259 | |||
| 260 | add_filter( 'excerpt_length', function( $length ) { return 30; } ); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -320,4 +320,31 @@ | ... | @@ -320,4 +320,31 @@ |
| 320 | top: 50%; | 320 | top: 50%; |
| 321 | transform: translate(-50%, -50%); | 321 | transform: translate(-50%, -50%); |
| 322 | background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="65.928" height="65.928" viewBox="0 0 65.928 65.928"><defs><clipPath id="clip-path"><rect id="Rectangle_250" data-name="Rectangle 250" width="65.928" height="65.928" fill="%23fff"/></clipPath></defs><g id="Group_1994" data-name="Group 1994" opacity="0.6"><g id="Group_1914" data-name="Group 1914"><path id="Path_1401" data-name="Path 1401" d="M112.886,81.243,91.2,94.52V67.966Z" transform="translate(-66.167 -48.109)" fill="%23fff"/><g id="Group_1516" data-name="Group 1516"><g id="Group_1515" data-name="Group 1515" clip-path="url(%23clip-path)"><path id="Path_1402" data-name="Path 1402" d="M32.964,65.928A32.964,32.964,0,1,1,65.929,32.964,33,33,0,0,1,32.964,65.928m0-57.886A24.922,24.922,0,1,0,57.887,32.964,24.95,24.95,0,0,0,32.964,8.042" fill="%23fff"/></g></g></g></g></svg>'); | 322 | background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="65.928" height="65.928" viewBox="0 0 65.928 65.928"><defs><clipPath id="clip-path"><rect id="Rectangle_250" data-name="Rectangle 250" width="65.928" height="65.928" fill="%23fff"/></clipPath></defs><g id="Group_1994" data-name="Group 1994" opacity="0.6"><g id="Group_1914" data-name="Group 1914"><path id="Path_1401" data-name="Path 1401" d="M112.886,81.243,91.2,94.52V67.966Z" transform="translate(-66.167 -48.109)" fill="%23fff"/><g id="Group_1516" data-name="Group 1516"><g id="Group_1515" data-name="Group 1515" clip-path="url(%23clip-path)"><path id="Path_1402" data-name="Path 1402" d="M32.964,65.928A32.964,32.964,0,1,1,65.929,32.964,33,33,0,0,1,32.964,65.928m0-57.886A24.922,24.922,0,1,0,57.887,32.964,24.95,24.95,0,0,0,32.964,8.042" fill="%23fff"/></g></g></g></g></svg>'); |
| 323 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 323 | } | ||
| 324 | .featured-carousel{ | ||
| 325 | height: 400px; | ||
| 326 | } | ||
| 327 | .carousel:has(.featured-carousel){ | ||
| 328 | height: 400px; | ||
| 329 | .promo-text{ | ||
| 330 | h2 { | ||
| 331 | font-size:18px; | ||
| 332 | line-height:23px; | ||
| 333 | text-align: left; | ||
| 334 | } | ||
| 335 | |||
| 336 | p { | ||
| 337 | font-size: 1rem; | ||
| 338 | line-height: 1.5rem; | ||
| 339 | text-align: left; | ||
| 340 | } | ||
| 341 | |||
| 342 | } | ||
| 343 | .understrap-read-more-link{ | ||
| 344 | font-size: 14px; | ||
| 345 | line-height: 21px; | ||
| 346 | text-align: left; | ||
| 347 | } | ||
| 348 | } | ||
| 349 | |||
| 350 | ... | ... |
| ... | @@ -2,5 +2,5 @@ | ... | @@ -2,5 +2,5 @@ |
| 2 | Theme Name: MSF CA Child | 2 | Theme Name: MSF CA Child |
| 3 | Author: Tenzing Communications | 3 | Author: Tenzing Communications |
| 4 | Template: msf-ca | 4 | Template: msf-ca |
| 5 | Version: 1.0.523 | 5 | Version: 1.0.524 |
| 6 | */ | 6 | */ |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment