Commit 8fb385e6 by rajshah

fixed and done resource listing

parent f73d30cf
<section class="resource-listing py-80 makura-new">
<!-- Resources - Resources Listing -->
<?php
$resources_listing = get_field('resources_listing') ?: [];
if (isset($resources_listing) && is_array($resources_listing) && !empty($resources_listing)):
$enable_resources_listing = $resources_listing['enable_resources_listing'];
if ($enable_resources_listing):
$resources_items = $resources_listing['resources_items'] ?: [];
if (isset($resources_items) && is_array($resources_items) && !empty($resources_items)):
?>
<section class="resource-listing py-80 makura-new">
<div class="container">
<div class="row">
<div class="col-lg-4 col-xl-3">
<div class="toc slide-up">
<div class="category-list">
<ul>
<li class="active"><a href="#" class="sm-text"
data-target="business-and-administrative-documents">Business &
Administrative Documents</a></li>
<li><a href="#" class="sm-text" data-target="branding-and-design-resources">Branding & Design
Resources</a></li>
<li><a href="#" class="sm-text" data-target="content-and-social-media-management">Content & Social Media
Management</a></li>
<li><a href="#" class="sm-text" data-target="seo-and-digital-marketing">SEO & Digital Marketing</a></li>
<li><a href="#" class="sm-text" data-target="email-and-communication-tools">Email & Communication
Tools</a></li>
<?php foreach ($resources_items as $ri => $res_item):
$title = $res_item['title'] ?: '';
?>
<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>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
<div class="col-lg-8 col-xl-9">
<div class="resource-wrapper">
<div class="resource-block slide-up" id="business-and-administrative-documents">
<?php foreach ($resources_items as $ri => $res_item):
$title = $res_item['title'] ?: '';
$desc = $res_item['desc'] ?: '';
$select_resources = $res_item['select_resources'] ?: [];
?>
<div class="resource-block slide-up" id="<?php echo strtolower(str_replace(' ', '-', $title)); ?>">
<div class="section-title">
<h2>Business & Administrative Documents</h2>
<p>Access essential business and administrative templates to streamline processes, manage documentation,
and maintain professionalism.</p>
<?php if (!empty($title)): ?>
<h2><?php echo $title; ?></h2><?php endif; ?>
<?php if (!empty($desc)):
echo $desc ?: '';
endif; ?>
</div>
<?php if (!empty($select_resources) && isset($select_resources) && is_array($select_resources)): ?>
<div class="resources">
<div class="row">
<?php foreach ($select_resources as $sel_res):
if ($sel_res instanceof WP_Post) {
$post_id = $sel_res->ID;
$post_url = get_permalink($post_id);
$post_title = $sel_res->post_title;
$post_thumbnail_url = get_the_post_thumbnail_url($post_id, 'full');
if (!$post_thumbnail_url) {
$post_thumbnail_url = get_field('resources_fallback_featured_image', 'option');
}
$post_content = $sel_res->post_content;
$post_excerpt = $sel_res->post_excerpt;
?>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-02.png" alt=""
class="img-fluid">
<a href="<?php echo esc_url($post_url); ?>" class="d-block">
<img src="<?php echo esc_url($post_thumbnail_url); ?>"
alt="<?php echo esc_attr($post_title); ?>" class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Mercantile Domain Registration Cover Letter</a></h6>
<P class="sm-text">Cover Letter Generator for personal and official registration.</P>
<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 class="format-and-btn-wrapper d-flex justify-content-between">
<?php
$downloadable_resource = get_field('downloadable_resource', $post_id) ?: [];
if (isset($downloadable_resource) && is_array($downloadable_resource) && !empty($downloadable_resource)):
$enable_downloadable_resources = $downloadable_resource['enable_downloadable_resources'];
if ($enable_downloadable_resources && isset($enable_downloadable_resources)):
$upload_downloadable_resource = $downloadable_resource['upload_downloadable_resource'] ?: [];
$url = $upload_downloadable_resource['url'];
$subtype = $upload_downloadable_resource['subtype'];
switch (strtolower($subtype)) {
case 'pdf':
$icon_url = '/assets/img/pdf-icon.png';
break;
case 'doc':
case 'docx':
$icon_url = '/assets/img/word-icon.png';
break;
case 'xls':
case 'xlsx':
$icon_url = '/assets/img/excel-icon.png';
break;
case 'ppt':
case 'pptx':
$icon_url = '/assets/img/ppt-icon.png';
break;
default:
$icon_url = '/assets/img/pdf-icon.png';
}
endif;
endif;
?>
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-03.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Mercantile Domain Ownership Transfer</a></h6>
<P class="sm-text">Cover Letter Generator for personal and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-04.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Quote Template</a></h6>
<P class="sm-text">Register free Cover Letter Generator for .np domain registration for personal
and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-05.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Invoice Template</a></h6>
<P class="sm-text">Register free Cover Letter Generator for .np domain registration for personal
and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-06.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Proposal Template (PPT)</a></h6>
<P class="sm-text">Register free Cover Letter Generator for .np domain registration for personal
and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-07.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Meeting Agenda Template</a></h6>
<P class="sm-text">Register free Cover Letter Generator for .np domain registration for personal
and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="resource-block slide-up" id="branding-and-design-resources">
<div class="section-title">
<h2>Branding & Design Resources</h2>
<p>Access essential business and administrative templates to streamline processes, manage documentation,
and maintain professionalism.</p>
</div>
<div class="resources">
<div class="row">
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-02.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Mercantile Domain Registration Cover Letter</a></h6>
<P class="sm-text">Cover Letter Generator for personal and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-03.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Mercantile Domain Ownership Transfer</a></h6>
<P class="sm-text">Cover Letter Generator for personal and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-04.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Quote Template</a></h6>
<P class="sm-text">Register free Cover Letter Generator for .np domain registration for personal
and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-05.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Invoice Template</a></h6>
<P class="sm-text">Register free Cover Letter Generator for .np domain registration for personal
and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-06.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Proposal Template (PPT)</a></h6>
<P class="sm-text">Register free Cover Letter Generator for .np domain registration for personal
and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-07.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Meeting Agenda Template</a></h6>
<P class="sm-text">Register free Cover Letter Generator for .np domain registration for personal
and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="resource-block slide-up" id="content-and-social-media-management">
<div class="section-title">
<h2>Content & Social Media Management</h2>
<p>Access essential business and administrative templates to streamline processes, manage documentation,
and maintain professionalism.</p>
</div>
<div class="resources">
<div class="row">
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-02.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Mercantile Domain Registration Cover Letter</a></h6>
<P class="sm-text">Cover Letter Generator for personal and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-03.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Mercantile Domain Ownership Transfer</a></h6>
<P class="sm-text">Cover Letter Generator for personal and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-04.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Quote Template</a></h6>
<P class="sm-text">Register free Cover Letter Generator for .np domain registration for personal
and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-05.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Invoice Template</a></h6>
<P class="sm-text">Register free Cover Letter Generator for .np domain registration for personal
and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-06.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Proposal Template (PPT)</a></h6>
<P class="sm-text">Register free Cover Letter Generator for .np domain registration for personal
and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="resource-item d-xl-flex justify-content-start slide-up">
<div class="resource-image">
<a href="#" class="d-block">
<img src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/placeholder-07.png" alt=""
class="img-fluid">
</a>
</div>
<div class="resource-content">
<h6><a href="#">Meeting Agenda Template</a></h6>
<P class="sm-text">Register free Cover Letter Generator for .np domain registration for personal
and official registration.</P>
<div class="format-and-btn-wrapper d-flex justify-content-between">
<p class="sm-text">Format: <img
src="<?php echo get_parent_theme_file_uri(); ?>/assets/img/pdf-icon.png" alt=""></p>
<a href="#" class="mc-btn-underlined sm-text">View in Detail</a>
src="<?php echo get_parent_theme_file_uri() . $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>
</div>
</div>
</div>
<?php }endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</section>
\ No newline at end of file
</section>
<?php endif; endif; endif; ?>
<!-- !Resources - Resources Listing -->
\ No newline at end of file
......@@ -758,7 +758,7 @@ function my_acf_init_block_types()
// Resources - Resources Listing Block
acf_register_block_type(array(
'name' => 'Resources - Resources Listing Block',
'title' => __('Competitive Analysis Form Block'),
'title' => __('Resources Listing Block'),
'description' => __('Resources - Resources Listing Block for SEO Pages'),
'render_template' => 'blocks/resources/resource-listing.php',
'category' => 'formatting',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment