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
3a32cda3
Commit
3a32cda3
authored
Jul 08, 2025
by
rajshah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the xls document type in resource listing block v0.2
parent
12611fef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
76 deletions
+74
-76
resource-listing.php
blocks/resources/resource-listing.php
+74
-76
No files found.
blocks/resources/resource-listing.php
View file @
3a32cda3
...
@@ -6,47 +6,47 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
...
@@ -6,47 +6,47 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
if
(
$enable_resources_listing
)
:
if
(
$enable_resources_listing
)
:
$resources_items
=
$resources_listing
[
'resources_items'
]
?:
[];
$resources_items
=
$resources_listing
[
'resources_items'
]
?:
[];
if
(
isset
(
$resources_items
)
&&
is_array
(
$resources_items
)
&&
!
empty
(
$resources_items
))
:
if
(
isset
(
$resources_items
)
&&
is_array
(
$resources_items
)
&&
!
empty
(
$resources_items
))
:
?>
?>
<section
class=
"resource-listing py-80 makura-new"
>
<section
class=
"resource-listing py-80 makura-new"
>
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-4 col-xl-3"
>
<div
class=
"col-lg-4 col-xl-3"
>
<div
class=
"toc slide-up"
>
<div
class=
"toc slide-up"
>
<div
class=
"toc-title"
>
<div
class=
"toc-title"
>
<h6>
Table of Content
</h6>
<h6>
Table of Content
</h6>
</div>
</div>
<div
class=
"category-list"
>
<div
class=
"category-list"
>
<ul>
<ul>
<?php
foreach
(
$resources_items
as
$ri
=>
$res_item
)
:
<?php
foreach
(
$resources_items
as
$ri
=>
$res_item
)
:
$title
=
$res_item
[
'title'
]
?:
''
;
$title
=
$res_item
[
'title'
]
?:
''
;
?>
?>
<li
class=
"
<?php
echo
(
$ri
===
0
)
?
'active'
:
''
;
?>
"
><a
href=
"#"
class=
"sm-text"
<li
class=
"
<?php
echo
(
$ri
===
0
)
?
'active'
:
''
;
?>
"
><a
href=
"#"
class=
"sm-text"
data-target=
"
<?php
echo
strtolower
(
str_replace
(
' '
,
'-'
,
$title
));
?>
"
>
<?php
echo
esc_html
(
$title
);
?>
</a>
data-target=
"
<?php
echo
strtolower
(
str_replace
(
' '
,
'-'
,
$title
));
?>
"
>
<?php
echo
esc_html
(
$title
);
?>
</a>
</li>
</li>
<?php
endforeach
;
?>
<?php
endforeach
;
?>
</ul>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"col-lg-8 col-xl-9"
>
<div
class=
"col-lg-8 col-xl-9"
>
<div
class=
"resource-wrapper"
>
<div
class=
"resource-wrapper"
>
<?php
foreach
(
$resources_items
as
$ri
=>
$res_item
)
:
<?php
foreach
(
$resources_items
as
$ri
=>
$res_item
)
:
$title
=
$res_item
[
'title'
]
?:
''
;
$title
=
$res_item
[
'title'
]
?:
''
;
$desc
=
$res_item
[
'desc'
]
?:
''
;
$desc
=
$res_item
[
'desc'
]
?:
''
;
$select_resources
=
$res_item
[
'select_resources'
]
?:
[];
$select_resources
=
$res_item
[
'select_resources'
]
?:
[];
?>
?>
<div
class=
"resource-block slide-up"
id=
"
<?php
echo
strtolower
(
str_replace
(
' '
,
'-'
,
$title
));
?>
"
>
<div
class=
"resource-block slide-up"
id=
"
<?php
echo
strtolower
(
str_replace
(
' '
,
'-'
,
$title
));
?>
"
>
<div
class=
"section-title"
>
<div
class=
"section-title"
>
<?php
if
(
!
empty
(
$title
))
:
?>
<?php
if
(
!
empty
(
$title
))
:
?>
<h2>
<?php
echo
$title
;
?>
</h2>
<?php
endif
;
?>
<h2>
<?php
echo
$title
;
?>
</h2>
<?php
endif
;
?>
<?php
if
(
!
empty
(
$desc
))
:
<?php
if
(
!
empty
(
$desc
))
:
echo
$desc
?:
''
;
echo
$desc
?:
''
;
endif
;
?>
endif
;
?>
</div>
</div>
<?php
if
(
!
empty
(
$select_resources
)
&&
isset
(
$select_resources
)
&&
is_array
(
$select_resources
))
:
?>
<?php
if
(
!
empty
(
$select_resources
)
&&
isset
(
$select_resources
)
&&
is_array
(
$select_resources
))
:
?>
<div
class=
"resources"
>
<div
class=
"resources"
>
<div
class=
"row"
>
<div
class=
"row"
>
<?php
foreach
(
$select_resources
as
$sel_res
)
:
<?php
foreach
(
$select_resources
as
$sel_res
)
:
if
(
$sel_res
instanceof
WP_Post
)
{
if
(
$sel_res
instanceof
WP_Post
)
{
$post_id
=
$sel_res
->
ID
;
$post_id
=
$sel_res
->
ID
;
$post_url
=
get_permalink
(
$post_id
);
$post_url
=
get_permalink
(
$post_id
);
...
@@ -57,25 +57,25 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
...
@@ -57,25 +57,25 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
}
}
$post_content
=
$sel_res
->
post_content
;
$post_content
=
$sel_res
->
post_content
;
$post_excerpt
=
$sel_res
->
post_excerpt
;
$post_excerpt
=
$sel_res
->
post_excerpt
;
?>
?>
<div
class=
"col-sm-6"
>
<div
class=
"col-sm-6"
>
<div
class=
"resource-item d-sm-flex flex-sm-column flex-xl-row justify-content-xl-start slide-up"
>
<div
class=
"resource-item d-sm-flex flex-sm-column flex-xl-row justify-content-xl-start slide-up"
>
<div
class=
"resource-image"
>
<div
class=
"resource-image"
>
<a
href=
"
<?php
echo
esc_url
(
$post_url
);
?>
"
class=
"d-block"
>
<a
href=
"
<?php
echo
esc_url
(
$post_url
);
?>
"
class=
"d-block"
>
<img
src=
"
<?php
echo
esc_url
(
$post_thumbnail_url
);
?>
"
<img
src=
"
<?php
echo
esc_url
(
$post_thumbnail_url
);
?>
"
alt=
"
<?php
echo
esc_attr
(
$post_title
);
?>
"
class=
"img-fluid"
>
alt=
"
<?php
echo
esc_attr
(
$post_title
);
?>
"
class=
"img-fluid"
>
</a>
</a>
</div>
</div>
<div
class=
"resource-content"
>
<div
class=
"resource-content"
>
<div
class=
"rc-detail"
>
<div
class=
"rc-detail"
>
<h6><a
href=
"
<?php
echo
esc_url
(
$post_url
);
?>
"
>
<h6><a
href=
"
<?php
echo
esc_url
(
$post_url
);
?>
"
>
<?php
echo
esc_html
(
$post_title
);
?>
</a></h6>
<?php
echo
esc_html
(
$post_title
);
?>
</a></h6>
<P
class=
"sm-text"
>
<P
class=
"sm-text"
>
<?php
echo
wp_trim_words
(
$post_excerpt
,
8
,
'...'
)
?:
wp_trim_words
(
$post_content
,
8
,
'...'
);
?>
<?php
echo
wp_trim_words
(
$post_excerpt
,
8
,
'...'
)
?:
wp_trim_words
(
$post_content
,
8
,
'...'
);
?>
</P>
</P>
</div>
</div>
<div
class=
"format-and-btn-wrapper d-flex justify-content-between"
>
<div
class=
"format-and-btn-wrapper d-flex justify-content-between"
>
<?php
<?php
$downloadable_resource
=
get_field
(
'downloadable_resource'
,
$post_id
)
?:
[];
$downloadable_resource
=
get_field
(
'downloadable_resource'
,
$post_id
)
?:
[];
if
(
isset
(
$downloadable_resource
)
&&
is_array
(
$downloadable_resource
)
&&
!
empty
(
$downloadable_resource
))
:
if
(
isset
(
$downloadable_resource
)
&&
is_array
(
$downloadable_resource
)
&&
!
empty
(
$downloadable_resource
))
:
$enable_downloadable_resources
=
$downloadable_resource
[
'enable_downloadable_resources'
];
$enable_downloadable_resources
=
$downloadable_resource
[
'enable_downloadable_resources'
];
...
@@ -85,50 +85,47 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
...
@@ -85,50 +85,47 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
$subtype
=
$upload_downloadable_resource
[
'subtype'
];
$subtype
=
$upload_downloadable_resource
[
'subtype'
];
switch
(
strtolower
(
$subtype
))
{
switch
(
strtolower
(
$subtype
))
{
case
'pdf'
:
case
'pdf'
:
$icon
=
'PDF'
;
$icon
_url
=
get_field
(
'pdf_image'
,
'option'
)
;
break
;
break
;
case
'doc'
:
case
'doc'
:
case
'docx'
:
case
'docx'
:
$icon
=
'DOC'
;
$icon
_url
=
get_field
(
'doc_image'
,
'option'
)
;
break
;
break
;
case
'xls'
:
case
'xls'
:
case
'xlsx'
:
case
'xlsx'
:
case
'vnd.ms-excel'
:
case
'vnd.ms-excel'
:
case
'vnd.openxmlformats-officedocument.spreadsheetml.sheet'
:
case
'vnd.openxmlformats-officedocument.spreadsheetml.sheet'
:
$icon
=
'XLS'
;
$icon
_url
=
get_field
(
'xls_image'
,
'option'
)
;
break
;
break
;
case
'ppt'
:
case
'ppt'
:
case
'pptx'
:
case
'pptx'
:
case
'vnd.openxmlformats-officedocument.presentationml.presentation'
:
case
'vnd.openxmlformats-officedocument.presentationml.presentation'
:
$icon
=
'PPT'
;
$icon
_url
=
get_field
(
'ppt_image'
,
'option'
)
;
break
;
break
;
default
:
default
:
$icon
=
'PDF'
;
$icon
_url
=
get_field
(
'default_image'
,
'option'
)
;
}
}
endif
;
endif
;
endif
;
endif
;
?>
?>
<p
class=
"sm-text"
>
Format:
<img
src=
"
<?php
echo
esc_url
(
$icon_url
);
?>
"
<p
class=
"sm-text"
>
Format:
<img
src=
"
<?php
echo
esc_url
(
$icon_url
);
?>
"
alt=
"
<?php
echo
esc_attr
(
$subtype
);
?>
"
></p>
alt=
"
<?php
echo
esc_attr
(
$subtype
);
?>
"
></p>
<a
href=
"
<?php
echo
esc_url
(
$post_url
);
?>
"
class=
"mc-btn-underlined sm-text"
>
View in
<a
href=
"
<?php
echo
esc_url
(
$post_url
);
?>
"
class=
"mc-btn-underlined sm-text"
>
View in
Detail
</a>
Detail
</a>
</div>
</div>
</div>
</div>
<?php
}
endforeach
;
?>
</div>
</div>
</div>
<
?php
endif
;
?
>
<
/div
>
</div>
</div>
<?php
endforeach
;
?>
</div>
<?php
}
endforeach
;
?>
</div>
</div>
</div>
</div>
<?php
endif
;
?>
</div>
</div>
<?php
endforeach
;
?>
</div>
</div>
</section>
</div>
<?php
endif
;
</div>
endif
;
</div>
endif
;
?>
</section>
<?php
endif
;
endif
;
endif
;
?>
<!-- !Resources - Resources Listing -->
<!-- !Resources - Resources Listing -->
\ No newline at end of file
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