Files
powerservice/wp-content/themes/powerservices/template-parts/page-gutenberg-accordion.php
T

33 lines
1.7 KiB
PHP

<?php
/**
* Displays the current page's Gutenberg content in a visually last accordion.
*
* The template must be called as the first child of a flex-column <main>. Its
* high CSS order keeps it at the bottom of the page without changing DOM order.
*
* @package powerservices
*/
$page_content_id = get_queried_object_id();
$page_content = $page_content_id ? get_post_field( 'post_content', $page_content_id ) : '';
if ( ! trim( wp_strip_all_tags( (string) $page_content ) ) ) {
return;
}
?>
<section id="informacion-servicios-industriales" class="order-[999] w-full bg-[#eeeeee] text-color-5" aria-label="Más información">
<details class="home-content-accordion w-full overflow-hidden bg-[#eeeeee]">
<summary class="flex min-h-[51px] cursor-pointer list-none items-center justify-between gap-4 px-[25px] py-3 text-color-5 transition-colors hover:bg-[#e9e9e9] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-color-2 md:min-h-[44px] md:px-5">
<span class="text-[14px] font-normal leading-[1.2]">Más Información</span>
<span class="home-content-accordion__icon relative block h-[18px] w-[18px] shrink-0" aria-hidden="true">
<span class="absolute left-1/2 top-1/2 h-px w-[10px] -translate-x-1/2 -translate-y-1/2 bg-[#777777]"></span>
<span class="absolute left-1/2 top-1/2 h-[10px] w-px -translate-x-1/2 -translate-y-1/2 bg-[#777777] transition-transform motion-reduce:transition-none"></span>
</span>
</summary>
<div class="home-gutenberg-content border-t border-[#dedede] bg-white px-9 py-10 md:px-5 md:py-7">
<?php echo apply_filters( 'the_content', $page_content ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
</details>
</section>