12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- /**
- * Template part for displaying the site navigation.
- *
- * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
- *
- * @package Pen
- */
- ob_start( 'pen_compress_html' );
- $description = false;
- $site_description_display = pen_option_get( 'header_sitedescription_display' );
- if ( $site_description_display ) {
- $description = get_bloginfo( 'description', 'display' );
- }
- $site_title_display = pen_option_get( 'header_sitetitle_display' );
- $classes_sitetitle = trim(
- implode(
- ' ',
- array_filter(
- array(
- $description ? 'pen_has_description' : '',
- 'pen_sitetitle_' . ( sanitize_html_class( $site_title_display ) ? 'show' : 'hide' ),
- )
- )
- )
- );
- $site_link = home_url( false );
- ?>
- <a href="<?php echo esc_url( $site_link ); ?>" id="site-title" class="<?php echo esc_attr( $classes_sitetitle ); ?>" rel="home">
- <span class="site-title <?php echo ( ! $site_title_display ) ? 'pen_element_hidden ' : ''; ?><?php pen_class_animation( 'header_sitetitle' ); /* phpcs:ignore */ ?>">
- <?php
- bloginfo( 'name' );
- ?>
- </span>
- <?php
- $description = wp_strip_all_tags( $description );
- if ( 200 < strlen( $description ) ) {
- $description = substr( $description, 0, 100 ) . ' …'; /* phpcs:ignore */
- }
- if ( $description || is_customize_preview() ) {
- // CSS "margin" relies on :not(:empty) here hence no indentation, newlines, etc.
- ?>
- <span class="site-description <?php pen_class_animation( 'header_sitedescription' ); /* phpcs:ignore */ ?>"><?php echo $description; /* phpcs:ignore */ ?></span>
- <?php
- }
- ?>
- </a>
- <?php
- echo ob_get_clean(); /* phpcs:ignore */
|