Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
makura-2025
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Raj Shah
makura-2025
Commits
f0d16cf3
Commit
f0d16cf3
authored
Feb 04, 2025
by
rajshah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle format type and its images in resources listing
parent
b81a6c18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
resource-listing.php
blocks/resources/resource-listing.php
+14
-13
No files found.
blocks/resources/resource-listing.php
View file @
f0d16cf3
...
...
@@ -64,12 +64,13 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
</a>
</div>
<div
class=
"resource-content"
>
<div
class=
"rc-detail"
>
<h6><a
href=
"
<?php
echo
esc_url
(
$post_url
);
?>
"
>
<?php
echo
esc_html
(
$post_title
);
?>
</a></h6>
<P
class=
"sm-text"
>
<?php
echo
wp_trim_words
(
$post_excerpt
,
8
,
'...'
)
?:
wp_trim_words
(
$post_content
,
8
,
'...'
);
?>
</P></div>
<div
class=
"rc-detail"
>
<h6><a
href=
"
<?php
echo
esc_url
(
$post_url
);
?>
"
>
<?php
echo
esc_html
(
$post_title
);
?>
</a></h6>
<P
class=
"sm-text"
>
<?php
echo
wp_trim_words
(
$post_excerpt
,
8
,
'...'
)
?:
wp_trim_words
(
$post_content
,
8
,
'...'
);
?>
</P>
</div>
<div
class=
"format-and-btn-wrapper d-flex justify-content-between"
>
<?php
$downloadable_resource
=
get_field
(
'downloadable_resource'
,
$post_id
)
?:
[];
...
...
@@ -81,28 +82,28 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
$subtype
=
$upload_downloadable_resource
[
'subtype'
];
switch
(
strtolower
(
$subtype
))
{
case
'pdf'
:
$icon_url
=
'/assets/img/pdf-icon.png'
;
$icon_url
=
get_field
(
'pdf_image'
,
'option'
)
;
break
;
case
'doc'
:
case
'docx'
:
$icon_url
=
'/assets/img/word-icon.png'
;
$icon_url
=
get_field
(
'doc_image'
,
'option'
)
;
break
;
case
'xls'
:
case
'xlsx'
:
$icon_url
=
'/assets/img/excel-icon.png'
;
$icon_url
=
get_field
(
'xls_image'
,
'option'
)
;
break
;
case
'ppt'
:
case
'pptx'
:
$icon_url
=
'/assets/img/ppt-icon.png'
;
$icon_url
=
get_field
(
'ppt_image'
,
'option'
)
;
break
;
default
:
$icon_url
=
'/assets/img/pdf-icon.png'
;
$icon_url
=
get_field
(
'default_image'
,
'option'
)
;
}
endif
;
endif
;
?>
<p
class=
"sm-text"
>
Format:
<img
src=
"
<?php
echo
get_parent_theme_file_uri
()
.
$icon_url
;
?>
"
alt=
"
<?php
echo
esc_attr
(
$subtype
);
?>
"
></p>
<p
class=
"sm-text"
>
Format:
<img
src=
"
<?php
echo
esc_url
(
$icon_url
);
?>
"
alt=
"
<?php
echo
esc_attr
(
$subtype
);
?>
"
></p>
<a
href=
"
<?php
echo
esc_url
(
$post_url
);
?>
"
class=
"mc-btn-underlined sm-text"
>
View in
Detail
</a>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment