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,51 @@
<?php
/**
* Template part for displaying a message that posts cannot be found.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package PressBook
*/
?>
<section class="no-results not-found">
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'pressbook' ); ?></h1>
</header><!-- .page-header -->
<div class="page-content">
<?php
if ( is_home() && current_user_can( 'publish_posts' ) ) {
printf(
'<p>' . wp_kses(
/* translators: 1: link to WP admin new post page */
__( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'pressbook' ),
array(
'a' => array(
'href' => array(),
),
)
) . '</p>',
esc_url( admin_url( 'post-new.php' ) )
);
} elseif ( is_search() ) {
?>
<p><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'pressbook' ); ?></p>
<?php
get_search_form();
} else {
?>
<p><?php esc_html_e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'pressbook' ); ?></p>
<?php
get_search_form();
}
?>
</div><!-- .page-content -->
</section><!-- .no-results -->

View File

@ -0,0 +1,30 @@
<?php
/**
* Template part for displaying page content without title in page.php.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package PressBook
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'pb-article pb-singular' ); ?>>
<?php PressBook\TemplateTags::post_thumbnail(); ?>
<div class="pb-content">
<div class="entry-content">
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'pressbook' ),
'after' => '</div>',
)
);
?>
</div><!-- .entry-content -->
</div><!-- .pb-content -->
<?php PressBook\TemplateTags::edit_post_link(); ?>
</article><!-- #post-<?php the_ID(); ?> -->

View File

@ -0,0 +1,34 @@
<?php
/**
* Template part for displaying page content in page.php.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package PressBook
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'pb-article pb-singular' ); ?>>
<?php PressBook\TemplateTags::post_thumbnail(); ?>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->
<div class="pb-content">
<div class="entry-content">
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'pressbook' ),
'after' => '</div>',
)
);
?>
</div><!-- .entry-content -->
</div><!-- .pb-content -->
<?php PressBook\TemplateTags::edit_post_link(); ?>
</article><!-- #post-<?php the_ID(); ?> -->

View File

@ -0,0 +1,52 @@
<?php
/**
* Template part for displaying single post content in single.php.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package PressBook
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'pb-article pb-singular' ); ?>>
<?php PressBook\TemplateTags::post_thumbnail(); ?>
<header class="entry-header">
<?php
the_title( '<h1 class="entry-title">', '</h1>' );
if ( 'post' === get_post_type() ) {
?>
<div class="<?php echo esc_attr( PressBook\Options\Blog::entry_meta_class() ); ?>">
<?php
PressBook\TemplateTags::posted_on();
PressBook\TemplateTags::posted_by();
PressBook\TemplateTags::comments();
?>
</div><!-- .entry-meta -->
<?php
}
?>
</header><!-- .entry-header -->
<div class="pb-content">
<div class="entry-content">
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'pressbook' ),
'after' => '</div>',
)
);
?>
</div><!-- .entry-content -->
</div><!-- .pb-content -->
<?php
PressBook\TemplateTags::post_categories();
PressBook\TemplateTags::post_tags();
PressBook\TemplateTags::edit_post_link();
?>
</article><!-- #post-<?php the_ID(); ?> -->

View File

@ -0,0 +1,74 @@
<?php
/**
* Template part for displaying posts.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package PressBook
*/
$pressbook_has_content = ( ( '' !== get_the_excerpt() ) || has_post_thumbnail() || ( '' !== get_the_content() ) );
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'pb-article pb-archive' . ( $pressbook_has_content ? '' : ' pb-no-content' ) ); ?>>
<header class="entry-header">
<?php
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
if ( 'post' === get_post_type() ) {
?>
<div class="<?php echo esc_attr( PressBook\Options\Blog::entry_meta_class() ); ?>">
<?php
PressBook\TemplateTags::posted_on();
PressBook\TemplateTags::posted_by();
PressBook\TemplateTags::comments();
if ( is_home() && is_sticky() ) {
echo '<span class="pb-sticky">';
PressBook\IconsHelper::the_theme_svg( 'bookmark' );
echo ( '<span class="pb-sticky-label">' . esc_html( PressBook\Options\Blog::featured_label_text() ) . '</span>' );
echo '</span>';
}
?>
</div><!-- .entry-meta -->
<?php
}
?>
</header><!-- .entry-header -->
<?php
if ( $pressbook_has_content ) {
?>
<div class="pb-content">
<?php
PressBook\TemplateTags::post_thumbnail();
if ( ( '' !== get_the_excerpt() ) && PressBook\Helpers::show_excerpt() ) {
?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php
} else {
?>
<div class="entry-content">
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'pressbook' ),
'after' => '</div>',
)
);
?>
</div><!-- .entry-content -->
<?php
}
?>
</div><!-- .pb-content -->
<?php
}
PressBook\TemplateTags::post_categories();
?>
</article><!-- #post-<?php the_ID(); ?> -->

View File

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

View File

@ -0,0 +1,23 @@
<?php
/**
* Template part for displaying the footer copyright text.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package PressBook
*/
$pressbook_copyright_text = PressBook\Options\Footer::get_copyright_text();
?>
<div class="copyright-text">
<div class="u-wrapper copyright-text-wrap">
<?php
if ( '' !== $pressbook_copyright_text ) {
?>
<p><?php echo wp_kses( $pressbook_copyright_text, PressBook\Options\Footer::copyright_text_allowed_tags() ); ?></p>
<?php
}
?>
</div><!-- .copyright-text-wrap -->
</div><!-- .copyright-text -->

View File

@ -0,0 +1,30 @@
<?php
/**
* Template part for displaying the footer widgets section.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package PressBook
*/
$pressbook_active_footer_widgets = PressBook\Widget::get_active_footer_widgets();
if ( $pressbook_active_footer_widgets > 0 ) {
?>
<div class="footer-widgets footer-widgets-<?php echo esc_attr( $pressbook_active_footer_widgets ); ?>">
<div class="u-wrapper footer-widgets-wrap">
<?php
for ( $i = 1; $i <= PressBook\Widget::FOOTER_WIDGETS_COUNT; $i++ ) {
if ( is_active_sidebar( 'footer-' . $i ) ) {
?>
<aside id="<?php echo esc_attr( 'sidebar-footer-' . $i ); ?>" class="widget-area c-sidebar-footer <?php echo esc_attr( 'c-sidebar-footer-' . $i ); ?>">
<?php dynamic_sidebar( 'footer-' . $i ); ?>
</aside><!-- .c-sidebar-footer -->
<?php
}
}
?>
</div><!-- .footer-widgets-wrap -->
</div><!-- .footer-widgets -->
<?php
}

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
}