first commit

This commit is contained in:
2023-09-08 01:45:46 -07:00
commit 8cbf53172b
108 changed files with 29005 additions and 0 deletions

View File

@ -0,0 +1,68 @@
<?php
/**
* Template part for displaying the header block.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package PressBook
*/
$pressbook_header_block = PressBook\Options\HeaderBlock::get_header_block();
if ( empty( $pressbook_header_block ) ) {
return;
}
if ( ( is_front_page() && ! $pressbook_header_block['in_front'] ) ||
( is_home() && ! $pressbook_header_block['in_blog'] ) ||
( is_archive() && ! $pressbook_header_block['in_archive'] ) ||
( is_404() ) ||
( is_search() && ! $pressbook_header_block['in_archive'] ) ||
( is_single() && ! $pressbook_header_block['in_post'] ) ||
( ( ! is_front_page() && is_page() ) && ! $pressbook_header_block['in_page'] ) ) {
return;
}
$pressbook_header_block_query = new \WP_Query(
array(
'post_type' => 'wp_block',
'no_found_rows' => true,
'post__in' => ( empty( $pressbook_header_block['id'] ) ? array( 0 ) : array( $pressbook_header_block['id'] ) ),
)
);
if ( $pressbook_header_block_query->have_posts() ) {
if ( $pressbook_header_block['t_margin'] ) {
$pressbook_header_block_class = 'block-section header-block header-block-1 t-margin';
} else {
$pressbook_header_block_class = 'block-section header-block header-block-1';
}
?>
<div class="<?php echo esc_attr( $pressbook_header_block_class ); ?>">
<?php
if ( ! $pressbook_header_block['full_width'] ) {
?>
<div class="u-wrapper">
<?php
}
while ( $pressbook_header_block_query->have_posts() ) {
$pressbook_header_block_query->the_post();
?>
<div class="entry-content">
<?php the_content(); ?>
</div><!-- .entry-content -->
<?php
}
wp_reset_postdata();
if ( ! $pressbook_header_block['full_width'] ) {
?>
</div><!-- .u-wrapper -->
<?php
}
?>
</div><!-- .header-block-1 -->
<?php
}

View File

@ -0,0 +1,26 @@
<?php
/**
* Template part for displaying the primary navbar section.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package PressBook
*/
if ( has_nav_menu( 'menu-1' ) ) {
?>
<div class="primary-navbar">
<div class="u-wrapper primary-navbar-wrap">
<nav id="site-navigation" class="main-navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'pressbook' ); ?>">
<button class="primary-menu-toggle" aria-controls="primary-menu" aria-expanded="false" aria-label="<?php esc_attr_e( 'Toggle Primary Menu', 'pressbook' ); ?>">
<?php
PressBook\IconsHelper::the_theme_svg( 'menu' );
PressBook\IconsHelper::the_theme_svg( 'close' );
?>
</button>
<?php PressBook\Menu::primary_menu(); ?>
</nav><!-- #site-navigation -->
</div><!-- .primary-navbar-wrap -->
</div><!-- .primary-navbar -->
<?php
}

View File

@ -0,0 +1,28 @@
<?php
/**
* Template part for displaying the site branding section.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package PressBook
*/
if ( get_header_image() ) {
?>
<div class="site-branding" style="background-image: url(<?php header_image(); ?>);">
<?php
} else {
?>
<div class="site-branding">
<?php
}
?>
<div class="u-wrapper site-branding-wrap">
<div class="<?php echo esc_attr( PressBook\Options\SiteIdentity::logo_title_class() ); ?>">
<img alt="OGS" id="wordmark">
<!-- .site-title-tagline -->
</div><!-- .site-logo-title -->
<?php get_template_part( 'template-parts/header/top-banner' ); ?>
</div><!-- .site-branding-wrap -->
</div><!-- .site-branding -->

View File

@ -0,0 +1,64 @@
<?php
/**
* Template part for displaying the top banner section.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package PressBook
*/
$pressbook_tb_block = PressBook\Options\TopBanner::get_top_banner_block();
if ( ! empty( $pressbook_tb_block ) ) {
$pressbook_tb_block_query = new \WP_Query(
array(
'post_type' => 'wp_block',
'no_found_rows' => true,
'post__in' => array( $pressbook_tb_block ),
)
);
if ( $pressbook_tb_block_query->have_posts() ) {
while ( $pressbook_tb_block_query->have_posts() ) {
$pressbook_tb_block_query->the_post();
the_content();
}
wp_reset_postdata();
return;
}
}
$pressbook_top_banner = PressBook\Options\TopBanner::get_top_banner();
if ( '' === wp_get_attachment_image( $pressbook_top_banner['image'] ) ) {
return;
}
$pressbook_top_banner_has_link = ( '' !== $pressbook_top_banner['link_url'] );
?>
<div class="<?php echo esc_attr( PressBook\Options\TopBanner::top_banner_class( $pressbook_top_banner ) ); ?>">
<?php
if ( $pressbook_top_banner_has_link ) {
echo '<a class="top-banner-link"';
if ( $pressbook_top_banner['link_new_tab'] ) {
echo ' target="_blank"';
}
if ( '' !== $pressbook_top_banner['link_title'] ) {
echo ( ' title="' . esc_attr( $pressbook_top_banner['link_title'] ) . '"' );
}
if ( '' !== $pressbook_top_banner['link_rel'] ) {
echo ( ' rel="' . esc_attr( $pressbook_top_banner['link_rel'] ) . '"' );
}
echo ( ' href="' . esc_url( $pressbook_top_banner['link_url'] ) . '">' );
}
echo wp_get_attachment_image( $pressbook_top_banner['image'], 'full', false, array( 'class' => 'top-banner-image' ) );
if ( $pressbook_top_banner_has_link ) {
echo '</a>';
}
?>
</div><!-- .top-banner -->

View File

@ -0,0 +1,54 @@
<?php
/**
* Template part for displaying the top navbar section.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package PressBook
*/
if ( has_nav_menu( 'social' ) || has_nav_menu( 'menu-2' ) ) {
?>
<div class="top-navbar">
<div class="u-wrapper top-navbar-wrap">
<div class="<?php echo esc_attr( PressBook\Menu::top_menus_class() ); ?>">
<?php
if ( has_nav_menu( 'social' ) ) {
?>
<nav id="social-navigation" class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links', 'pressbook' ); ?>">
<?php
wp_nav_menu(
array(
'theme_location' => 'social',
'menu_id' => 'social-menu',
'depth' => 1,
'link_before' => '<span class="screen-reader-text">',
'link_after' => '</span>',
)
);
?>
</nav><!-- #social-navigation -->
<?php
}
if ( has_nav_menu( 'menu-2' ) ) {
?>
<nav id="top-navigation" class="top-navigation" aria-label="<?php esc_attr_e( 'Top Menu', 'pressbook' ); ?>">
<?php
wp_nav_menu(
array(
'theme_location' => 'menu-2',
'menu_id' => 'top-menu',
'depth' => 1,
)
);
?>
</nav><!-- #top-navigation -->
<?php
}
?>
</div><!-- .top-menus -->
</div><!-- .top-navbar-wrap -->
</div><!-- .top-navbar -->
<?php
}