37 lines
1.5 KiB
PHP
37 lines
1.5 KiB
PHP
<!-- Quick Links Section -->
|
|
<?php
|
|
|
|
$current_slug = get_post_field('post_name', get_post());
|
|
$pages = get_pages_as_array();
|
|
$subpages = getSubpagesForSlug($pages, $current_slug);
|
|
|
|
if (count($subpages) > 0) { ?>
|
|
|
|
<!-- Quick Links -->
|
|
<div class="px-2">
|
|
<ul role="list" class="max-w-7xl mx-auto text-blue-500 bg-white border-blue-500 border py-4 mb-4 rounded-md">
|
|
<li class="accordion">
|
|
<div class="flex px-2 rounded-md justify-between">
|
|
<div class="gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold flex items-center align-middle">
|
|
<p>Quick Links</p>
|
|
</div>
|
|
<button class="accordion-toggle">
|
|
<i class="fas fa-chevron-down items-center ml-auto rounded-md bg-gray-900 px-2.5 py-2 text-white ring-1 ring-inset ring-gray-700" aria-hidden="true"></i>
|
|
<i class="fas fa-times items-center ml-auto rounded-md bg-gray-900 px-3 py-2 text-white ring-1 ring-inset ring-gray-700" aria-hidden="true"></i>
|
|
</button>
|
|
</div>
|
|
<ul class="accordion-content space-y-2">
|
|
<?php
|
|
foreach ($subpages as $subpage) { ?>
|
|
<li class="p-2">
|
|
<a href="<?php echo get_site_url() . '/' . $pages[$subpage->post_parent]['page']->post_name . '/' . $subpage->post_name ?>" class="flex space-x-2 items-center"><i class="bi-caret-right-fill"></i>
|
|
<p><?php echo $subpage->post_title ?></p>
|
|
</a>
|
|
</li>
|
|
<?php } ?>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<?php }
|