Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# WordPress Theme Development
*.log
*.cache
.DS_Store
Thumbs.db
.idea/
.vscode/
*.sublime-project
*.sublime-workspace
node_modules/
vendor/
.sass-cache/
*.css.map
*.js.map
package-lock.json
.env
.env.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
14 changes: 11 additions & 3 deletions 404.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<?php get_header(); ?>
<?php
/**
* The template for displaying 404 pages (Not Found)
*
* @package StaticCore
* @since StaticCore 1.0.0
*/

get_header(); ?>
<article id="post-0" class="post not-found">
<header class="header">
<h1 class="entry-title" itemprop="name"><?php esc_html_e( 'Not Found', 'staticCore' ); ?></h1>
<h1 class="entry-title" itemprop="name"><?php esc_html_e( 'Not Found', 'static-core' ); ?></h1>
</header>
<div class="entry-content" itemprop="mainContentOfPage">
<p><?php esc_html_e( 'Nothing found for the requested page. Try a search instead?', 'staticCore' ); ?></p>
<p><?php esc_html_e( 'Nothing found for the requested page. Try a search instead?', 'static-core' ); ?></p>
<?php get_search_form(); ?>
</div>
</article>
Expand Down
10 changes: 9 additions & 1 deletion archive.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<?php get_header(); ?>
<?php
/**
* The template for displaying Archive pages
*
* @package StaticCore
* @since StaticCore 1.0.0
*/

get_header(); ?>
<header class="header">
<h1 class="entry-title" itemprop="name"><?php the_archive_title(); ?></h1>
<div class="archive-meta" itemprop="description"><?php if ( '' != the_archive_description() ) { echo esc_html( the_archive_description() ); } ?></div>
Expand Down
2 changes: 1 addition & 1 deletion attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<header class="header">
<h1 class="entry-title" itemprop="name"><?php the_title(); ?></h1> <?php edit_post_link(); ?>
<?php get_template_part( 'entry', 'meta' ); ?>
<a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php printf( esc_attr__( 'Return to %s', 'staticCore' ), esc_attr( get_the_title( $post->post_parent ), 1 ) ); ?>" rev="attachment"><?php printf( esc_attr__( '%s Return to ', 'staticCore' ), '<span class="meta-nav">&larr;</span>' ); ?><?php echo wp_kses_post( get_the_title( $post->post_parent ) ); ?></a>
<a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php printf( esc_attr__( 'Return to %s', 'static-core' ), esc_attr( get_the_title( $post->post_parent ), 1 ) ); ?>" rev="attachment"><?php printf( esc_attr__( '%s Return to ', 'static-core' ), '<span class="meta-nav">&larr;</span>' ); ?><?php echo wp_kses_post( get_the_title( $post->post_parent ) ); ?></a>
<nav id="nav-above" class="navigation">
<div class="nav-previous"><?php previous_image_link( false, '&lsaquo;' ); ?></div>
<div class="nav-next"><?php next_image_link( false, '&rsaquo;' ); ?></div>
Expand Down
8 changes: 8 additions & 0 deletions comments.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<?php
/**
* The template for displaying Comments
*
* @package StaticCore
* @since StaticCore 1.0.0
*/
?>
<div id="comments">
<?php
if ( have_comments() ) :
Expand Down
6 changes: 3 additions & 3 deletions entry-footer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<footer class="entry-footer">
<span class="cat-links"><?php esc_html_e( 'Categories: ', 'staticCore' ); ?><?php the_category( ', ' ); ?></span>
<span class="tag-links"><?php the_tags(); ?></span>
<?php if ( comments_open() ) { echo '<span class="meta-sep">|</span> <span class="comments-link"><a href="' . esc_url( get_comments_link() ) . '">' . sprintf( esc_html__( 'Comments', 'staticCore' ) ) . '</a></span>'; } ?>
<span class="cat-links"><?php esc_html_e( 'Categories: ', 'static-core' ); ?><?php the_category( ', ' ); ?></span>
<?php the_tags( '<span class="tag-links">' . esc_html__( 'Tags: ', 'static-core' ), ', ', '</span>' ); ?>
<?php if ( comments_open() ) { echo '<span class="meta-sep">|</span> <span class="comments-link"><a href="' . esc_url( get_comments_link() ) . '">' . sprintf( esc_html__( 'Comments', 'static-core' ) ) . '</a></span>'; } ?>
</footer>
2 changes: 1 addition & 1 deletion entry-summary.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="entry-summary">
<?php if ( ( has_post_thumbnail() ) && ( !is_search() ) ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail(); ?></a>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'full', array( 'alt' => the_title_attribute( array( 'echo' => false ) ) ) ); ?></a>
<?php endif; ?>
<div itemprop="description"><?php the_excerpt(); ?></div>
<?php if ( is_search() ) { ?>
Expand Down
10 changes: 9 additions & 1 deletion footer.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<?php
/**
* The footer template file
*
* @package StaticCore
* @since StaticCore 1.0.0
*/
?>
</main>
<?php get_sidebar(); ?>
</div>
<footer id="footer">
<div id="copyright">
&copy; <?php echo esc_html( date_i18n( __( 'Y', 'staticCore' ) ) ); ?> <?php echo esc_html( get_bloginfo( 'name' ) ); ?>
&copy; <?php echo esc_html( date_i18n( __( 'Y', 'static-core' ) ) ); ?> <?php echo esc_html( get_bloginfo( 'name' ) ); ?>
</div>
</footer>
</div>
Expand Down
66 changes: 55 additions & 11 deletions functions.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
<?php
/**
* StaticCore functions and definitions
*
* @package StaticCore
* @since StaticCore 1.0.0
*/

add_action( 'after_setup_theme', 'staticCore_setup' );
function staticCore_setup() {
load_theme_textdomain( 'staticCore', get_template_directory() . '/languages' );
load_theme_textdomain( 'static-core', get_template_directory() . '/languages' );
add_theme_support( 'title-tag' );
add_theme_support( 'custom-logo' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'html5', array( 'search-form', 'navigation-widgets' ) );
add_theme_support( 'html5', array( 'search-form', 'navigation-widgets', 'comment-list', 'comment-form', 'gallery', 'caption', 'style', 'script' ) );
add_theme_support( 'appearance-tools' );
add_theme_support( 'woocommerce' );
global $content_width;
if ( !isset( $content_width ) ) { $content_width = 1920; }
add_theme_support( 'align-wide' );
add_theme_support( 'editor-styles' );
add_theme_support( 'wp-block-styles' );
add_theme_support( 'custom-line-height' );
add_theme_support( 'custom-spacing' );
register_nav_menus( array( 'main-menu' => esc_html__( 'Main Menu', 'static-core' ) ) );
}
add_action( 'wp_enqueue_scripts', 'staticCore_enqueue' );
function staticCore_enqueue() {
//These are the staticCore stylesheets and should remain at the top. Place all of your vendor/custom stylesheets below these to avoid overwritten styles conflicts
wp_enqueue_style( 'staticCore-style', get_stylesheet_uri() );
wp_enqueue_style( 'staticCore-icons', get_template_directory_uri() . '/icons/icons.css' );
wp_enqueue_style( 'staticCore-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ) );
wp_enqueue_style( 'staticCore-icons', get_template_directory_uri() . '/icons/icons.css', array(), wp_get_theme()->get( 'Version' ) );
//Add Vendor Stylesheets or your own additional stylesheets here use the example below as a guide:
//Place these styles in the /assets/css or assets/vendor/css folders
//
// wp_enqueue_style( 'staticCore-animate', get_template_directory_uri() . '/assets/vendor/css/animate.min.css', array(), '4.1.1' );

wp_enqueue_script( 'jquery' );
wp_register_script( 'straticCore-videos', get_template_directory_uri() . '/js/videos.js' );
wp_register_script( 'staticCore-videos', get_template_directory_uri() . '/js/videos.js', array( 'jquery' ), wp_get_theme()->get( 'Version' ), true );
wp_enqueue_script( 'staticCore-videos' );
wp_add_inline_script( 'staticCore-videos', 'jQuery(document).ready(function($){$("#wrapper").vids();});' );
//Add vendor or custom JS files here, use the example below as a guide:
Expand Down Expand Up @@ -151,19 +161,19 @@ function staticCore_wp_body_open() {
}
add_action( 'wp_body_open', 'staticCore_skip_link', 5 );
function staticCore_skip_link() {
echo '<a href="#content" class="skip-link screen-reader-text">' . esc_html__( 'Skip to the content', 'staticCore' ) . '</a>';
echo '<a href="#content" class="skip-link screen-reader-text">' . esc_html__( 'Skip to the content', 'static-core' ) . '</a>';
}
add_filter( 'the_content_more_link', 'staticCore_read_more_link' );
function staticCore_read_more_link() {
if ( !is_admin() ) {
return ' <a href="' . esc_url( get_permalink() ) . '" class="more-link">' . sprintf( __( '...%s', 'staticCore' ), '<span class="screen-reader-text"> ' . esc_html( get_the_title() ) . '</span>' ) . '</a>';
return ' <a href="' . esc_url( get_permalink() ) . '" class="more-link">' . sprintf( __( '...%s', 'static-core' ), '<span class="screen-reader-text"> ' . esc_html( get_the_title() ) . '</span>' ) . '</a>';
}
}
add_filter( 'excerpt_more', 'staticCore_excerpt_read_more_link' );
function staticCore_excerpt_read_more_link( $more ) {
if ( !is_admin() ) {
global $post;
return ' <a href="' . esc_url( get_permalink( $post->ID ) ) . '" class="more-link">' . sprintf( __( '...%s', 'staticCore' ), '<span class="screen-reader-text"> ' . esc_html( get_the_title() ) . '</span>' ) . '</a>';
return ' <a href="' . esc_url( get_permalink( $post->ID ) ) . '" class="more-link">' . sprintf( __( '...%s', 'static-core' ), '<span class="screen-reader-text"> ' . esc_html( get_the_title() ) . '</span>' ) . '</a>';
}
}
add_filter( 'big_image_size_threshold', '__return_false' );
Expand All @@ -177,20 +187,54 @@ function staticCore_image_insert_override( $sizes ) {
add_action( 'widgets_init', 'staticCore_widgets_init' );
function staticCore_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar Widget Area', 'staticCore' ),
'name' => esc_html__( 'Sidebar Widget Area', 'static-core' ),
'id' => 'primary-widget-area',
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
'after_widget' => '</li>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'customize_register', 'staticCore_customize_selective_refresh' );
function staticCore_customize_selective_refresh( $wp_customize ) {
if ( isset( $wp_customize->selective_refresh ) ) {
$wp_customize->selective_refresh->add_partial( 'blogname', array(
'selector' => '#site-title',
'render_callback' => function() {
bloginfo( 'name' );
},
) );
$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
'selector' => '#site-description',
'render_callback' => function() {
bloginfo( 'description' );
},
) );
}
}
add_action( 'wp_head', 'staticCore_pingback_header' );
function staticCore_pingback_header() {
if ( is_singular() && pings_open() ) {
printf( '<link rel="pingback" href="%s">' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) );
}
}
add_action( 'customize_register', 'staticCore_customize_register' );
function staticCore_customize_register( $wp_customize ) {
$wp_customize->add_section( 'staticCore_social_media', array(
'title' => esc_html__( 'Social Media', 'static-core' ),
'priority' => 130,
) );
$wp_customize->add_setting( 'custom_og_image', array(
'default' => get_template_directory_uri() . '/screenshot.jpg',
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'custom_og_image', array(
'label' => esc_html__( 'Open Graph Image', 'static-core' ),
'section' => 'staticCore_social_media',
'settings' => 'custom_og_image',
'description' => esc_html__( 'Default image for social media sharing (recommended: 1200x630px)', 'static-core' ),
) ) );
}
add_action( 'comment_form_before', 'staticCore_enqueue_comment_reply_script' );
function staticCore_enqueue_comment_reply_script() {
if ( get_option( 'thread_comments' ) ) {
Expand Down
46 changes: 27 additions & 19 deletions header.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
<?php
/**
* The header template file
*
* @package StaticCore
* @since StaticCore 1.0.0
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?> <?php staticCore_schema_type(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<meta name="description" content="<?php if ( is_single() ) { echo esc_html( wp_strip_all_tags( get_the_excerpt(), true ) ); } else { bloginfo( 'description' ); } ?>">
<meta name="description" content="<?php if ( is_single() ) { echo esc_attr( wp_strip_all_tags( get_the_excerpt(), true ) ); } else { echo esc_attr( get_bloginfo( 'description', 'display' ) ); } ?>">

<!-- SEO & Social Meta -->
<meta name="title" content="<?php bloginfo( 'name' ); ?>">
<meta name="title" content="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
<meta name="robots" content="index, follow">
<link rel="canonical" href="<?php echo esc_url( home_url( add_query_arg( null, null ) ) ); ?>">
<meta property="og:type" content="website">
<meta property="og:title" content="<?php bloginfo( 'name' ); ?>">
<meta property="og:description" content="<?php bloginfo( 'description' ); ?>">
<meta property="og:title" content="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
<meta property="og:description" content="<?php echo esc_attr( get_bloginfo( 'description', 'display' ) ); ?>">
<meta property="og:url" content="<?php echo esc_url( home_url() ); ?>">
<meta property="og:image" content="<?php echo esc_url( get_template_directory_uri() . '/assets/img/og/sdf.og.img.png' ); ?>">
<meta property="og:image:alt" content="The Spencer Davis Foundation - saving lives through awareness, education, training, and equipment.">
<meta property="og:image" content="<?php echo esc_url( get_theme_mod( 'custom_og_image', get_template_directory_uri() . '/screenshot.jpg' ) ); ?>">
<meta property="og:image:alt" content="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="<?php bloginfo( 'name' ); ?>">
<meta name="twitter:description" content="<?php bloginfo( 'description' ); ?>">
<meta name="twitter:image" content="<?php echo esc_url( get_template_directory_uri() . '/assets/img/og/sdf.og.img.png' ); ?>">
<meta name="twitter:title" content="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
<meta name="twitter:description" content="<?php echo esc_attr( get_bloginfo( 'description', 'display' ) ); ?>">
<meta name="twitter:image" content="<?php echo esc_url( get_theme_mod( 'custom_og_image', get_template_directory_uri() . '/screenshot.jpg' ) ); ?>">
<!--favicon-->
<link rel="icon" href="<?php echo esc_url( get_template_directory_uri() . '/assets/icons/favicon.svg' ); ?>" type="image/x-icon">
<link rel="apple-touch-icon" href="<?php echo esc_url( get_template_directory_uri() . '/assets/icons/favicon.svg' ); ?>">
<link rel="icon" href="<?php echo esc_url( has_site_icon() ? get_site_icon_url() : get_template_directory_uri() . '/screenshot.jpg' ); ?>" type="image/x-icon">
<link rel="apple-touch-icon" href="<?php echo esc_url( has_site_icon() ? get_site_icon_url() : get_template_directory_uri() . '/screenshot.jpg' ); ?>">
<!-- google fonts if needed, uncomment and change to the correct url for your fonts.
<link href="https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Inter:wght@400;500;600&family=Nunito:wght@800&family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
-->
Expand All @@ -38,19 +46,19 @@ function gtag(){dataLayer.push(arguments);}
{
"@context": "https://www.schema.org/",
"@type": "WebSite",
"name": "<?php bloginfo( 'name' ); ?>",
"url": "<?php echo esc_url( home_url() ); ?>/"
"name": "<?php echo esc_js( get_bloginfo( 'name', 'display' ) ); ?>",
"url": "<?php echo esc_url( home_url( '/' ) ); ?>"
}
</script>
<script type="application/ld+json">
{
"@context": "https://www.schema.org/",
"@type": "Organization",
"name": "<?php bloginfo( 'name' ); ?>",
"url": "<?php echo esc_url( home_url() ); ?>/",
"name": "<?php echo esc_js( get_bloginfo( 'name', 'display' ) ); ?>",
"url": "<?php echo esc_url( home_url( '/' ) ); ?>",
"logo": "<?php if ( has_custom_logo() ) { $custom_logo_id = get_theme_mod( 'custom_logo' ); $logo = wp_get_attachment_image_src( $custom_logo_id , 'full' ); echo esc_url( $logo[0] ); } ?>",
"image": "<?php if ( has_site_icon() ) { echo esc_url( get_site_icon_url() ); } ?>",
"description": "<?php bloginfo( 'description' ); ?>"
"description": "<?php echo esc_js( get_bloginfo( 'description', 'display' ) ); ?>"
}
</script>
<?php wp_head(); ?>
Expand Down Expand Up @@ -89,13 +97,13 @@ function gtag(){dataLayer.push(arguments);}
}
?>
</div>
<div id="site-description"<?php if ( !is_single() ) { echo ' itemprop="description"'; } ?>><?php bloginfo( 'description' ); ?></div>
<div id="site-description"<?php if ( !is_single() ) { echo ' itemprop="description"'; } ?>><?php echo esc_html( get_bloginfo( 'description', 'display' ) ); ?></div>
</div>
<nav id="menu" itemscope itemtype="https://schema.org/SiteNavigationElement">
<span class="looper before" tabindex="0"></span>
<button type="button" class="menu-toggle first"><span class="menu-icon">&#9776;</span><span class="menu-text screen-reader-text"><?php esc_html_e( ' Menu', 'staticCore' ); ?></span></button>
<button type="button" class="menu-toggle first"><span class="menu-icon">&#9776;</span><span class="menu-text screen-reader-text"><?php esc_html_e( ' Menu', 'static-core' ); ?></span></button>
<?php wp_nav_menu( array( 'theme_location' => 'main-menu', 'link_before' => '<span itemprop="name">', 'link_after' => '</span>' ) ); ?>
<div id="search"><form method="get" class="search-form" action="<?php echo esc_url( home_url() ); ?>/"><label><span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'staticCore' ); ?></span><input type="search" class="search-field last" placeholder="<?php esc_attr_e( 'Search …', 'staticCore' ); ?>" value="" name="s"><span></span></label><input type="submit" class="search-submit" value="<?php esc_attr_e( 'Search', 'staticCore' ); ?>"></form></div>
<div id="search"><form method="get" class="search-form" action="<?php echo esc_url( home_url() ); ?>/"><label><span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'static-core' ); ?></span><input type="search" class="search-field last" placeholder="<?php esc_attr_e( 'Search …', 'static-core' ); ?>" value="" name="s"><span></span></label><input type="submit" class="search-submit" value="<?php esc_attr_e( 'Search', 'static-core' ); ?>"></form></div>
<span class="looper after" tabindex="0"></span>
</nav>
</header>
Expand Down
7 changes: 7 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php
/**
* The main template file
*
* @package StaticCore
* @since StaticCore 1.0.0
*/

get_header();
if ( have_posts() ) : while ( have_posts() ) : the_post();
get_template_part( 'entry' );
Expand Down
4 changes: 2 additions & 2 deletions nav-below.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php $args = array(
'prev_text' => sprintf( esc_html__( '%s older', 'generic' ), '<span class="meta-nav">&larr;</span>' ),
'next_text' => sprintf( esc_html__( 'newer %s', 'generic' ), '<span class="meta-nav">&rarr;</span>' )
'prev_text' => sprintf( esc_html__( '%s older', 'static-core' ), '<span class="meta-nav">&larr;</span>' ),
'next_text' => sprintf( esc_html__( 'newer %s', 'static-core' ), '<span class="meta-nav">&rarr;</span>' )
);
the_posts_navigation( $args );
10 changes: 9 additions & 1 deletion page.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<?php get_header(); ?>
<?php
/**
* The template for displaying all pages
*
* @package StaticCore
* @since StaticCore 1.0.0
*/

get_header(); ?>
<!--
** place html/php for any static sections that will be on all pages here.
** See examples in docs
Expand Down
Loading