Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
MSF
/
msf-climate-hub
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
81631c1e
authored
2023-09-02 19:57:14 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
alt
Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent
04045307
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
wp-content/themes/msf-child/blocks/carousel/carousel.php
wp-content/themes/msf-child/loop-templates/content-search.php
wp-content/themes/msf-child/blocks/carousel/carousel.php
View file @
81631c1
...
...
@@ -48,8 +48,14 @@ $carousel_style = get_field('carousel_style');
<?php
$image
=
get_sub_field
(
'image'
);
?>
<div
class=
"row"
>
<div
class=
"col-lg-4 col-md-12 promo-image"
>
<?php
$image
=
get_the_post_thumbnail_url
(
$page
->
ID
,
'medium'
,
array
(
'class'
=>
'no-lazy-load'
)
);
?>
<img
src=
"
<?php
echo
$image
;
?>
"
alt=
""
loading=
"eager"
>
<?php
$image
=
get_the_post_thumbnail_url
(
$page
->
ID
,
'medium'
);
$thumbnail_id
=
get_post_meta
(
$page
->
ID
,
'_thumbnail_id'
,
true
);
$img_alt
=
get_post_meta
(
$thumbnail_id
,
'_wp_attachment_image_alt'
,
true
);
if
(
!
$img_alt
){
$img_alt
=
get_the_title
(
$thumbnail_id
);
}
?>
<img
src=
"
<?php
echo
$image
;
?>
"
alt=
"
<?php
echo
$img_alt
?>
"
loading=
"eager"
>
</div>
<div
class=
"col-lg-8 col-md-12"
>
<div
class=
"promo-text"
>
<?php
echo
get_the_excerpt
(
$page
->
ID
);
?>
<a
class=
"understrap-read-more-link"
href=
"
<?php
echo
get_permalink
(
$page
->
ID
);
?>
"
>
READ MORE
</a></div>
...
...
wp-content/themes/msf-child/loop-templates/content-search.php
View file @
81631c1
...
...
@@ -52,14 +52,16 @@ if ( !empty( $terms ) && !is_wp_error( $terms ) ){
if
(
$imgid
)
{
$image
=
wp_get_attachment_image_src
(
$imgid
,
'medium'
);
$image
=
$image
[
0
];
$image_alt
=
get_post_meta
(
$imgid
,
'_wp_attachment_image_alt'
,
TRUE
);
}
else
if
(
$img
)
{
$image
=
$img
;
$image_alt
=
get_field
(
'alt_text'
,
$search_posts
[
$i
][
'ID'
]);
}
$image_alt
=
get_post_meta
(
$imgid
,
'_wp_attachment_image_alt'
,
true
);
if
(
!
$image_alt
){
$image_alt
=
get_the_title
(
$imgid
);
}
?>
<img
src=
'
#'
data-src=
"
<?=
$image
?>
"
class=
'lazy'
alt=
'
<?=
$image_alt
?>
'
/>
<img
src=
'
<?=
$image
?>
'
loading=
"eager"
alt=
'
<?=
$image_alt
?>
'
/>
</div>
<?php
endif
;
?>
<div
class=
'content'
>
...
...
Please
register
or
sign in
to post a comment