web-wordpress-kit/kit/template-parts/content-page.php

48 lines
1.3 KiB
PHP

<?php
$kit_categories = get_the_category();
//get name of first category
$kit_category_name = $kit_categories[0]->name;
//get category url
$kit_category_url = get_category_link( $kit_categories[0]->term_id );
?>
<section class="full-width background-color-page-theme" id="c3318">
<?php if ( has_post_thumbnail() ) { ?>
<div class="intro-element align-center background-color-page-theme-contrast" style="background-image: url(<?php echo get_the_post_thumbnail_url(); ?>);">
<?php } else {
$custom_logo_id = get_theme_mod( 'kit_defaultimage' );
$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
?>
<div class="intro-element align-center background-color-page-theme-contrast" style="background-image: url(<?php echo esc_url( $logo[0] ); ?>);">
<?php } ?>
<div class="content-wrap">
<?php if ( has_category() ) { ?>
<a href="<?php echo esc_url( $kit_category_url ); ?>" class="page-category-marker">
<span>
<?php echo esc_html( $kit_category_name ); ?>
</span>
</a>
<?php } ?>
<div id="centeredMultiLine">
<?php the_title( '<h1>', '</h1>' ); ?>
</div>
</div>
</div>
</section>
<section class="background-color-white">
<div class="content-wrap">
<article>
<?php the_content(); ?>
</article>
</div>
</section>