2023-01-21 01:31:34 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2023-11-26 14:32:25 +01:00
|
|
|
* Partial: Inner Header
|
2023-01-21 01:31:34 +01:00
|
|
|
*
|
2023-11-26 14:32:25 +01:00
|
|
|
* Renders the inner header.
|
2023-01-21 01:31:34 +01:00
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Fictioneer
|
2024-01-26 17:45:59 +01:00
|
|
|
* @since 5.0.0
|
2023-01-21 01:31:34 +01:00
|
|
|
*
|
2023-08-03 20:39:31 +02:00
|
|
|
* @internal $args['post_id'] Optional. Current post ID.
|
|
|
|
* @internal $args['story_id'] Optional. Current story ID (if chapter).
|
|
|
|
* @internal $args['header_image_url'] URL of the filtered header image or false.
|
|
|
|
* @internal $args['header_args'] Arguments passed to the header.php partial.
|
2023-01-21 01:31:34 +01:00
|
|
|
*/
|
|
|
|
|
2023-08-20 20:21:48 +02:00
|
|
|
|
|
|
|
// No direct access!
|
|
|
|
defined( 'ABSPATH' ) OR exit;
|
|
|
|
|
2023-11-24 23:34:57 +01:00
|
|
|
// Setup
|
2024-01-23 14:52:56 +01:00
|
|
|
$header_style = get_theme_mod( 'header_style', 'default' );
|
2024-02-29 01:54:21 +01:00
|
|
|
$show_title_shadow = get_theme_mod( 'title_text_shadow', false );
|
2024-01-23 14:52:56 +01:00
|
|
|
$tag = in_array( $header_style, ['default', 'overlay'] ) ? 'header' : 'div';
|
2024-03-16 21:27:29 +01:00
|
|
|
$title_tag = is_front_page() ? 'h1' : 'div';
|
|
|
|
$logo_tag = ( display_header_text() || ! is_front_page() ) ? 'div' : 'h1';
|
2023-11-24 23:34:57 +01:00
|
|
|
|
2023-08-20 20:21:48 +02:00
|
|
|
?>
|
|
|
|
|
2023-11-24 23:34:57 +01:00
|
|
|
<<?php echo $tag; ?> class="header hide-on-fullscreen">
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2023-11-26 14:24:09 +01:00
|
|
|
<?php do_action( 'fictioneer_inner_header', $args ); ?>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-01-23 14:52:56 +01:00
|
|
|
<?php if ( in_array( $header_style, ['default', 'overlay'] ) ) : ?>
|
2023-11-24 23:34:57 +01:00
|
|
|
<div class="header__content">
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2023-11-24 23:34:57 +01:00
|
|
|
<?php if ( has_custom_logo() ) : ?>
|
2024-03-16 21:27:29 +01:00
|
|
|
<<?php echo $logo_tag; ?> class="header__logo"><?php the_custom_logo(); ?></<?php echo $logo_tag; ?>>
|
2023-11-24 23:34:57 +01:00
|
|
|
<?php endif; ?>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2023-11-24 23:34:57 +01:00
|
|
|
<?php if ( display_header_text() ) : ?>
|
2024-02-28 23:24:21 +01:00
|
|
|
<div class="header__title <?php if ( ! $show_title_shadow ) echo '_no-text-shadow'; ?>">
|
2024-03-16 21:27:29 +01:00
|
|
|
<<?php echo $title_tag; ?> class="header__title-heading"><a href="<?php echo esc_url( home_url() ); ?>" class="header__title-link" rel="home"><?php echo get_bloginfo( 'name' ); ?></a></<?php echo $title_tag; ?>>
|
2023-11-24 23:34:57 +01:00
|
|
|
<?php if ( ! empty( get_bloginfo( 'description' ) ) ) : ?>
|
|
|
|
<div class="header__title-tagline"><?php echo get_bloginfo( 'description' ); ?></div>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2023-11-24 23:34:57 +01:00
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2023-11-24 23:34:57 +01:00
|
|
|
</<?php echo $tag; ?>>
|