24ee969b by Jeff Balicki

slider

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent a828d3ce
...@@ -42,15 +42,16 @@ $carousel_style = get_field('carousel_style'); ...@@ -42,15 +42,16 @@ $carousel_style = get_field('carousel_style');
42 <div class=" carousel-items promo-carousel"> 42 <div class=" carousel-items promo-carousel">
43 <div class='swiper-wrapper'> 43 <div class='swiper-wrapper'>
44 <?php while( the_repeater_field('promo_items') ): ?> 44 <?php while( the_repeater_field('promo_items') ): ?>
45 <?php $page = get_sub_field('page'); ?>
45 <div class="swiper-slide"> 46 <div class="swiper-slide">
46 <div class="carousel-content"> 47 <div class="carousel-content">
47 <?php $image = get_sub_field('image'); ?> 48 <?php $image = get_sub_field('image'); ?>
48 <div class="row"> 49 <div class="row">
49 <div class="col-lg-4 col-md-12 promo-image" style=background-image:url(); > 50 <div class="col-lg-4 col-md-12 promo-image" >
50 <img src="<?php echo $image['url'];?>" alt="<?php echo $image['alt'];?>"> 51 <?php echo get_the_post_thumbnail( $page->ID, 'thumbnail' ); ?>
51 </div> 52 </div>
52 <div class="col-lg-8 col-md-12"> 53 <div class="col-lg-8 col-md-12">
53 <div class="promo-text"><?php the_sub_field('text'); ?></div> 54 <div class="promo-text"><?php echo get_the_excerpt($page->ID); ?></div>
54 </div> 55 </div>
55 </div> 56 </div>
56 </div> 57 </div>
......
...@@ -20232,6 +20232,10 @@ ul.sf_date_field .sf-datepicker { ...@@ -20232,6 +20232,10 @@ ul.sf_date_field .sf-datepicker {
20232 } 20232 }
20233 } 20233 }
20234 20234
20235 .promo-image {
20236 width: 325px;
20237 height: 178px;
20238 }
20235 .promo-image img { 20239 .promo-image img {
20236 width: 100%; 20240 width: 100%;
20237 } 20241 }
...@@ -20248,6 +20252,8 @@ ul.sf_date_field .sf-datepicker { ...@@ -20248,6 +20252,8 @@ ul.sf_date_field .sf-datepicker {
20248 } 20252 }
20249 .promo-carousel .promo-text { 20253 .promo-carousel .promo-text {
20250 margin-left: 1.25rem; 20254 margin-left: 1.25rem;
20255 margin-left: 1.25rem;
20256 text-align: left;
20251 } 20257 }
20252 @media only screen and (max-width: 62.5rem) { 20258 @media only screen and (max-width: 62.5rem) {
20253 .promo-carousel .promo-text { 20259 .promo-carousel .promo-text {
...@@ -20255,6 +20261,14 @@ ul.sf_date_field .sf-datepicker { ...@@ -20255,6 +20261,14 @@ ul.sf_date_field .sf-datepicker {
20255 margin-top: 1.25rem; 20261 margin-top: 1.25rem;
20256 } 20262 }
20257 } 20263 }
20264 .promo-carousel .understrap-read-more-link {
20265 font-weight: bold;
20266 text-transform: uppercase;
20267 text-decoration: none;
20268 }
20269 .promo-carousel .understrap-read-more-link:hover {
20270 text-decoration: underline;
20271 }
20258 20272
20259 .swiper-button-next.swiper-button-disabled, 20273 .swiper-button-next.swiper-button-disabled,
20260 .swiper-button-prev.swiper-button-disabled { 20274 .swiper-button-prev.swiper-button-disabled {
......
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.
1 <?php
2 /**
3 * Custom functions that act independently of the theme templates
4 *
5 * Eventually, some of the functionality here could be replaced by core features.
6 *
7 * @package Understrap
8 */
9
10 // Exit if accessed directly.
11 defined( 'ABSPATH' ) || exit;
12
13 add_filter( 'body_class', 'understrap_body_classes' );
14
15 if ( ! function_exists( 'understrap_body_classes' ) ) {
16 /**
17 * Adds custom classes to the array of body classes.
18 *
19 * @param array $classes Classes for the body element.
20 *
21 * @return array
22 */
23 function understrap_body_classes( $classes ) {
24 // Adds a class of group-blog to blogs with more than 1 published author.
25 if ( is_multi_author() ) {
26 $classes[] = 'group-blog';
27 }
28 // Adds a class of hfeed to non-singular pages.
29 if ( ! is_singular() ) {
30 $classes[] = 'hfeed';
31 }
32
33 // Adds a body class based on the presence of a sidebar.
34 $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
35 if ( is_page_template(
36 array(
37 'page-templates/fullwidthpage.php',
38 'page-templates/no-title.php',
39 )
40 ) ) {
41 $classes[] = 'understrap-no-sidebar';
42 } elseif (
43 is_page_template(
44 array(
45 'page-templates/both-sidebarspage.php',
46 'page-templates/left-sidebarpage.php',
47 'page-templates/right-sidebarpage.php',
48 )
49 )
50 ) {
51 $classes[] = 'understrap-has-sidebar';
52 } elseif ( 'none' !== $sidebar_pos ) {
53 $classes[] = 'understrap-has-sidebar';
54 } else {
55 $classes[] = 'understrap-no-sidebar';
56 }
57
58 return $classes;
59 }
60 }
61
62 if ( function_exists( 'understrap_adjust_body_class' ) ) {
63 /*
64 * understrap_adjust_body_class() deprecated in v0.9.4. We keep adding the
65 * filter for child themes which use their own understrap_adjust_body_class.
66 */
67 add_filter( 'body_class', 'understrap_adjust_body_class' );
68 }
69
70 // Filter custom logo with correct classes.
71 add_filter( 'get_custom_logo', 'understrap_change_logo_class' );
72
73 if ( ! function_exists( 'understrap_change_logo_class' ) ) {
74 /**
75 * Replaces logo CSS class.
76 *
77 * @param string $html Markup.
78 *
79 * @return string
80 */
81 function understrap_change_logo_class( $html ) {
82
83 $html = str_replace( 'class="custom-logo"', 'class="img-fluid"', $html );
84 $html = str_replace( 'class="custom-logo-link"', 'class="navbar-brand custom-logo-link"', $html );
85 $html = str_replace( 'alt=""', 'title="Home" alt="logo"', $html );
86
87 return $html;
88 }
89 }
90
91 if ( ! function_exists( 'understrap_pingback' ) ) {
92 /**
93 * Add a pingback url auto-discovery header for single posts of any post type.
94 */
95 function understrap_pingback() {
96 if ( is_singular() && pings_open() ) {
97 echo '<link rel="pingback" href="' . esc_url( get_bloginfo( 'pingback_url' ) ) . '">' . "\n";
98 }
99 }
100 }
101 add_action( 'wp_head', 'understrap_pingback' );
102
103 if ( ! function_exists( 'understrap_mobile_web_app_meta' ) ) {
104 /**
105 * Add mobile-web-app meta.
106 */
107 function understrap_mobile_web_app_meta() {
108 echo '<meta name="mobile-web-app-capable" content="yes">' . "\n";
109 echo '<meta name="apple-mobile-web-app-capable" content="yes">' . "\n";
110 echo '<meta name="apple-mobile-web-app-title" content="' . esc_attr( get_bloginfo( 'name' ) ) . ' - ' . esc_attr( get_bloginfo( 'description' ) ) . '">' . "\n";
111 }
112 }
113 add_action( 'wp_head', 'understrap_mobile_web_app_meta' );
114
115 if ( ! function_exists( 'understrap_default_body_attributes' ) ) {
116 /**
117 * Adds schema markup to the body element.
118 *
119 * @param array<string,string> $atts An associative array of attributes.
120 * @return array<string,string>
121 */
122 function understrap_default_body_attributes( $atts ) {
123 $atts['itemscope'] = '';
124 $atts['itemtype'] = 'http://schema.org/WebSite';
125 return $atts;
126 }
127 }
128 add_filter( 'understrap_body_attributes', 'understrap_default_body_attributes' );
129
130 // Escapes all occurances of 'the_archive_description'.
131 add_filter( 'get_the_archive_description', 'understrap_escape_the_archive_description' );
132
133 if ( ! function_exists( 'understrap_escape_the_archive_description' ) ) {
134 /**
135 * Escapes the description for an author or post type archive.
136 *
137 * @param string $description Archive description.
138 * @return string Maybe escaped $description.
139 */
140 function understrap_escape_the_archive_description( $description ) {
141 if ( is_author() || is_post_type_archive() ) {
142 return wp_kses_post( $description );
143 }
144
145 /*
146 * All other descriptions are retrieved via term_description() which returns
147 * a sanitized description.
148 */
149 return $description;
150 }
151 } // End of if function_exists( 'understrap_escape_the_archive_description' ).
152
153 // Escapes all occurances of 'the_title()' and 'get_the_title()'.
154 add_filter( 'the_title', 'understrap_kses_title' );
155
156 // Escapes all occurances of 'the_archive_title' and 'get_the_archive_title()'.
157 add_filter( 'get_the_archive_title', 'understrap_kses_title' );
158
159 if ( ! function_exists( 'understrap_kses_title' ) ) {
160 /**
161 * Sanitizes data for allowed HTML tags for titles.
162 *
163 * @param string $data Title to filter.
164 * @return string Filtered title with allowed HTML tags and attributes intact.
165 */
166 function understrap_kses_title( $data ) {
167
168 // Get allowed tags and protocols.
169 $allowed_tags = wp_kses_allowed_html( 'post' );
170 $allowed_protocols = wp_allowed_protocols();
171 if (
172 in_array( 'polylang/polylang.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true )
173 || in_array( 'polylang-pro/polylang.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true )
174 ) {
175 if ( ! in_array( 'data', $allowed_protocols, true ) ) {
176 $allowed_protocols[] = 'data';
177 }
178 }
179
180 if ( has_filter( 'understrap_kses_title' ) ) {
181 /**
182 * Filters the allowed HTML tags and attributes in titles.
183 *
184 * @param array<string,array<string,bool>> $allowed_tags Allowed HTML tags and attributes in titles.
185 */
186 $allowed_tags = apply_filters_deprecated( 'understrap_kses_title', array( $allowed_tags ), '1.2.0' );
187 }
188
189 return wp_kses( $data, $allowed_tags, $allowed_protocols );
190 }
191 } // End of if function_exists( 'understrap_kses_title' ).
192
193 if ( ! function_exists( 'understrap_hide_posted_by' ) ) {
194 /**
195 * Hides the posted by markup in `understrap_posted_on()`.
196 *
197 * @since 1.0.0
198 *
199 * @param string $byline Posted by HTML markup.
200 * @return string Maybe filtered posted by HTML markup.
201 */
202 function understrap_hide_posted_by( $byline ) {
203 if ( is_author() ) {
204 return '';
205 }
206 return $byline;
207 }
208 }
209 add_filter( 'understrap_posted_by', 'understrap_hide_posted_by' );
210
211
212 add_filter( 'excerpt_more', 'understrap_custom_excerpt_more' );
213
214 if ( ! function_exists( 'understrap_custom_excerpt_more' ) ) {
215 /**
216 * Removes the ... from the excerpt read more link
217 *
218 * @param string $more The excerpt.
219 *
220 * @return string
221 */
222 function understrap_custom_excerpt_more( $more ) {
223 if ( ! is_admin() ) {
224 $more = '';
225 }
226 return $more;
227 }
228 }
229
230 add_filter( 'wp_trim_excerpt', 'understrap_all_excerpts_get_more_link' );
231
232 if ( ! function_exists( 'understrap_all_excerpts_get_more_link' ) ) {
233 /**
234 * Adds a custom read more link to all excerpts, manually or automatically generated
235 *
236 * @param string $post_excerpt Posts's excerpt.
237 *
238 * @return string
239 */
240 function understrap_all_excerpts_get_more_link( $post_excerpt ) {
241 if ( is_admin() || ! get_the_ID() ) {
242 return $post_excerpt;
243 }
244
245 $permalink = esc_url( get_permalink( (int) get_the_ID() ) ); // @phpstan-ignore-line -- post exists
246
247 return $post_excerpt . ' [...]<a class="understrap-read-more-link" href="' . $permalink . '">' . __(
248 ' Read More',
249 'understrap'
250 ) . '<span class="screen-reader-text"> from ' . get_the_title( get_the_ID() ) . '</span></a>';
251
252 }
253 }
...@@ -45,6 +45,8 @@ padding: 0rem 3.125rem; ...@@ -45,6 +45,8 @@ padding: 0rem 3.125rem;
45 } 45 }
46 } 46 }
47 .promo-image{ 47 .promo-image{
48 width: 325px;
49 height: 178px;
48 img{ 50 img{
49 width: 100%; 51 width: 100%;
50 } 52 }
...@@ -62,11 +64,22 @@ padding: 0rem 3.125rem; ...@@ -62,11 +64,22 @@ padding: 0rem 3.125rem;
62 } 64 }
63 .promo-text{ 65 .promo-text{
64 margin-left: 1.25rem; 66 margin-left: 1.25rem;
67 margin-left: 1.25rem;
68 text-align: left;
65 @media only screen and (max-width: 62.5rem) { 69 @media only screen and (max-width: 62.5rem) {
66 margin-left: 0rem; 70 margin-left: 0rem;
67 margin-top: 1.25rem; 71 margin-top: 1.25rem;
68 } 72 }
69 } 73 }
74 .understrap-read-more-link{
75 font-weight: bold;
76 text-transform: uppercase;
77 text-decoration: none;
78
79 }
80 .understrap-read-more-link:hover{
81 text-decoration:underline;
82 }
70 } 83 }
71 84
72 .swiper-button-next.swiper-button-disabled, 85 .swiper-button-next.swiper-button-disabled,
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
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.450 5 Version: 1.0.451
6 */ 6 */
7 7
......