From d3a18177e6ab3b26da3b28dbbe8f4225b6f16e84 Mon Sep 17 00:00:00 2001 From: Jami Gibbs Date: Fri, 10 Jun 2016 10:34:30 -0500 Subject: [PATCH 01/16] Adding screenshot to README, closes #7 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 38bc11b..db39711 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Scribe is a WordPress theme that excels as a writing presentation tool. The focus is on your words. You'll have access to several customization settings within the native WordPress Customizer such as sitewide colors, logo image, and custom background image settings. +![preview](screenshot.png) + ### Installation 1. In your admin panel, go to Appearance > Themes and click the Add New button. From c7aadaa4c1c4a2bb952ab42c6f45acd1c9192082 Mon Sep 17 00:00:00 2001 From: Jami Gibbs Date: Fri, 10 Jun 2016 10:58:45 -0500 Subject: [PATCH 02/16] Fixes images with caption alignment --- scss/partials/_media.scss | 4 ++++ style.css | 3 +++ 2 files changed, 7 insertions(+) diff --git a/scss/partials/_media.scss b/scss/partials/_media.scss index 4a113cb..a0bc1be 100644 --- a/scss/partials/_media.scss +++ b/scss/partials/_media.scss @@ -16,3 +16,7 @@ iframe, object { max-width: 100%; } + +figure.wp-caption { + margin: 0; +} diff --git a/style.css b/style.css index 05a41eb..73946d6 100644 --- a/style.css +++ b/style.css @@ -641,6 +641,9 @@ iframe, object { max-width: 100%; } +figure.wp-caption { + margin: 0; } + /*-------------------------------------------------------------- 7.1 Captions --------------------------------------------------------------*/ From 87570a9557d0075a2caeb07b56f61c5ca2598843 Mon Sep 17 00:00:00 2001 From: Jami Gibbs Date: Fri, 10 Jun 2016 11:00:35 -0500 Subject: [PATCH 03/16] Adjusting image alignment --- scss/partials/_captions.scss | 10 ++++++++++ scss/partials/_media.scss | 4 ---- style.css | 10 +++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/scss/partials/_captions.scss b/scss/partials/_captions.scss index 7c2f9a9..98a8634 100644 --- a/scss/partials/_captions.scss +++ b/scss/partials/_captions.scss @@ -19,3 +19,13 @@ .wp-caption-text { text-align: center; } + +figure.wp-caption { + margin: 0; + &.alignleft { + margin-right: 1.5em; + } + &.alignright { + margin-left: 1.5em; + } +} diff --git a/scss/partials/_media.scss b/scss/partials/_media.scss index a0bc1be..4a113cb 100644 --- a/scss/partials/_media.scss +++ b/scss/partials/_media.scss @@ -16,7 +16,3 @@ iframe, object { max-width: 100%; } - -figure.wp-caption { - margin: 0; -} diff --git a/style.css b/style.css index 73946d6..266fa2b 100644 --- a/style.css +++ b/style.css @@ -641,9 +641,6 @@ iframe, object { max-width: 100%; } -figure.wp-caption { - margin: 0; } - /*-------------------------------------------------------------- 7.1 Captions --------------------------------------------------------------*/ @@ -662,6 +659,13 @@ figure.wp-caption { .wp-caption-text { text-align: center; } +figure.wp-caption { + margin: 0; } + figure.wp-caption.alignleft { + margin-right: 1.5em; } + figure.wp-caption.alignright { + margin-left: 1.5em; } + /*-------------------------------------------------------------- 7.2 Galleries --------------------------------------------------------------*/ From 07eb029ca1086c28fca3ba457c71fa30b69f2bc3 Mon Sep 17 00:00:00 2001 From: Jami Gibbs Date: Fri, 10 Jun 2016 11:19:58 -0500 Subject: [PATCH 04/16] Improved header mobile display --- js/app.js | 4 ++-- scss/partials/_header.scss | 11 +++++++++++ style.css | 9 +++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index de891e9..37fec19 100644 --- a/js/app.js +++ b/js/app.js @@ -31,8 +31,8 @@ }); // Hide the nav when the 'x' is clicked - $('.nav-panel').on('click', function(event){ - if( $(event.target).is('.nav-panel-close') ) { + $('.nav-panel-header').on('click', function(event){ + if( $(event.target).is('.nav-panel-close, .nav-panel-header, h6') ) { // Prevent the default click event from occuring event.preventDefault(); $('.nav-panel').removeClass('is-visible'); diff --git a/scss/partials/_header.scss b/scss/partials/_header.scss index 76b494e..32ed5c4 100644 --- a/scss/partials/_header.scss +++ b/scss/partials/_header.scss @@ -24,6 +24,17 @@ font-size: 16px; color: $headers; } + img { + @include bp-small { + margin: 0 auto; + display: table; + } + } + @include bp-small { + text-align: center; + padding: 0; + width: 100%; + } } .primary-bg-image { diff --git a/style.css b/style.css index 266fa2b..3ee4019 100644 --- a/style.css +++ b/style.css @@ -210,6 +210,15 @@ input[type="submit"] { .site-branding .site-description { font-size: 16px; color: #000000; } + @media screen and (max-width: 39.9375em) { + .site-branding img { + margin: 0 auto; + display: table; } } + @media screen and (max-width: 39.9375em) { + .site-branding { + text-align: center; + padding: 0; + width: 100%; } } .primary-bg-image { position: relative; From 30086357f64c9412f4fa780fa969c87e73165b0f Mon Sep 17 00:00:00 2001 From: Jami Gibbs Date: Fri, 10 Jun 2016 11:30:17 -0500 Subject: [PATCH 05/16] Improved footer mobile display --- scss/partials/_footer.scss | 6 ++++++ style.css | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/scss/partials/_footer.scss b/scss/partials/_footer.scss index e3e5ce3..7fe490b 100644 --- a/scss/partials/_footer.scss +++ b/scss/partials/_footer.scss @@ -24,6 +24,12 @@ font-size: 16px; margin: 2em 0 2em 0; padding-top: 2em; + @include bp-small { + text-align: center; + } + @include bp-medium { + text-align: center; + } } } diff --git a/style.css b/style.css index 3ee4019..bbfff2e 100644 --- a/style.css +++ b/style.css @@ -734,5 +734,11 @@ figure.wp-caption { font-size: 16px; margin: 2em 0 2em 0; padding-top: 2em; } + @media screen and (max-width: 39.9375em) { + .site-footer .site-info { + text-align: center; } } + @media screen and (min-width: 40em) and (max-width: 63.9375em) { + .site-footer .site-info { + text-align: center; } } /*# sourceMappingURL=style.css.map */ From 5ab0228973596a68f3ed2f2100b35435756b5017 Mon Sep 17 00:00:00 2001 From: Jami Gibbs Date: Fri, 10 Jun 2016 11:38:40 -0500 Subject: [PATCH 06/16] Improved post mobile display --- scss/partials/_posts-pages.scss | 19 +++++++++++++++++++ style.css | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/scss/partials/_posts-pages.scss b/scss/partials/_posts-pages.scss index 21b4c23..1f62a21 100644 --- a/scss/partials/_posts-pages.scss +++ b/scss/partials/_posts-pages.scss @@ -66,6 +66,16 @@ article { .home-featured-img { margin-top: 0.5em; + @include bp-small { + margin: 0 auto; + display: table; + margin-bottom: 1em; + } + @include bp-medium { + margin: 0 auto; + display: table; + margin-bottom: 1em; + } } .entry-content { @@ -154,6 +164,15 @@ h2.entry-title, h1.entry-title { margin-bottom: 0; } +.home h2.entry-title, .blog h2.entry-title, .home h4.subtitle, .blog h4.subtitle, .home .entry-meta, .blog .entry-meta { + @include bp-small { + text-align: center; + } + @include bp-medium { + text-align: center; + } +} + .entry-footer { @extend %secondaryfont; border-top: 1px solid #efefef; diff --git a/style.css b/style.css index bbfff2e..f2a4072 100644 --- a/style.css +++ b/style.css @@ -400,6 +400,16 @@ header .sticky { article .home-featured-img { margin-top: 0.5em; } + @media screen and (max-width: 39.9375em) { + article .home-featured-img { + margin: 0 auto; + display: table; + margin-bottom: 1em; } } + @media screen and (min-width: 40em) and (max-width: 63.9375em) { + article .home-featured-img { + margin: 0 auto; + display: table; + margin-bottom: 1em; } } article .entry-content h1, article .entry-content h2, article .entry-content h3, article .entry-content h4, article .entry-content h5, article .entry-content h6 { margin-bottom: 1em; } article .entry-content img { @@ -462,6 +472,13 @@ h2.entry-title, h1.entry-title { font-size: 36px; margin-bottom: 0; } +@media screen and (max-width: 39.9375em) { + .home h2.entry-title, .blog h2.entry-title, .home h4.subtitle, .blog h4.subtitle, .home .entry-meta, .blog .entry-meta { + text-align: center; } } +@media screen and (min-width: 40em) and (max-width: 63.9375em) { + .home h2.entry-title, .blog h2.entry-title, .home h4.subtitle, .blog h4.subtitle, .home .entry-meta, .blog .entry-meta { + text-align: center; } } + .entry-footer { border-top: 1px solid #efefef; padding: 2em 0 3em 0; } From 2d16094a2d4bf2eb141f7ea28694e2d876b18a6a Mon Sep 17 00:00:00 2001 From: Jami Gibbs Date: Fri, 10 Jun 2016 11:49:09 -0500 Subject: [PATCH 07/16] Adjusting image spacing, fixes #4 --- scss/partials/_captions.scss | 2 +- style.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scss/partials/_captions.scss b/scss/partials/_captions.scss index 98a8634..99ce54e 100644 --- a/scss/partials/_captions.scss +++ b/scss/partials/_captions.scss @@ -21,7 +21,7 @@ } figure.wp-caption { - margin: 0; + margin: 0 0 2em 0; &.alignleft { margin-right: 1.5em; } diff --git a/style.css b/style.css index f2a4072..95f0570 100644 --- a/style.css +++ b/style.css @@ -686,7 +686,7 @@ object { text-align: center; } figure.wp-caption { - margin: 0; } + margin: 0 0 2em 0; } figure.wp-caption.alignleft { margin-right: 1.5em; } figure.wp-caption.alignright { From b27671a3b11cf34ccfaa7081230a5e32b4f28f94 Mon Sep 17 00:00:00 2001 From: Jami Gibbs Date: Fri, 10 Jun 2016 12:02:33 -0500 Subject: [PATCH 08/16] Adds dynamic version to stylesheet, closes #9 --- functions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 576d7b5..9ecbaf4 100644 --- a/functions.php +++ b/functions.php @@ -121,10 +121,16 @@ function scribe_widgets_init() { * Enqueue scripts and styles. */ function scribe_scripts() { + + /** + * Get the theme's version number for cache busting + */ + $scribe_theme = wp_get_theme(); + wp_enqueue_style( 'scribe-foundation-style', get_stylesheet_directory_uri() . '/vendor/foundation/foundation.css', array(), '6.2.3', 'all' ); wp_enqueue_style( 'scribe-fonts', scribe_fonts_url(), array(), null ); - wp_enqueue_style( 'scribe-style', get_stylesheet_uri() ); + wp_enqueue_style( 'scribe-style', get_stylesheet_uri(), array(), $scribe_theme['Version'] ); wp_enqueue_script( 'scribe-foundation-core', get_template_directory_uri() . '/vendor/foundation/foundation.js', array('jquery'), '6.2.2', false); wp_enqueue_script( 'scribe-app', get_template_directory_uri() . '/js/app.js', array('jquery'), '1.0.0', true); From c09ad74d72b18caa14b0980fe6fb9d115c193eb1 Mon Sep 17 00:00:00 2001 From: Jami Gibbs Date: Fri, 10 Jun 2016 12:06:13 -0500 Subject: [PATCH 09/16] Fixes post comments link alignmnet, closes #1 --- scss/partials/_posts-pages.scss | 4 ++-- style.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scss/partials/_posts-pages.scss b/scss/partials/_posts-pages.scss index 1f62a21..7fc10d5 100644 --- a/scss/partials/_posts-pages.scss +++ b/scss/partials/_posts-pages.scss @@ -177,8 +177,8 @@ h2.entry-title, h1.entry-title { @extend %secondaryfont; border-top: 1px solid #efefef; padding: 2em 0 3em 0; - .cat-links, .tag-links, .edit-link { - display:block; + .cat-links, .tag-links, .edit-link, .comments-link{ + display: block; } } diff --git a/style.css b/style.css index 95f0570..a72210d 100644 --- a/style.css +++ b/style.css @@ -482,7 +482,7 @@ h2.entry-title, h1.entry-title { .entry-footer { border-top: 1px solid #efefef; padding: 2em 0 3em 0; } - .entry-footer .cat-links, .entry-footer .tag-links, .entry-footer .edit-link { + .entry-footer .cat-links, .entry-footer .tag-links, .entry-footer .edit-link, .entry-footer .comments-link { display: block; } .posts-navigation .nav-previous, .posts-navigation .nav-next, .navigation .nav-previous, .navigation .nav-next { From ac266479b64ddc4524ee76dbad66c3473ff98cf7 Mon Sep 17 00:00:00 2001 From: Jami Gibbs Date: Fri, 10 Jun 2016 12:47:25 -0500 Subject: [PATCH 10/16] Subtitle meta implementation improved --- inc/meta.php | 58 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/inc/meta.php b/inc/meta.php index 9deccf8..f2fb0a4 100644 --- a/inc/meta.php +++ b/inc/meta.php @@ -5,45 +5,53 @@ * @package scribe */ -function scribe_subtitle() { - add_meta_box('scribe_subtitle_metabox', 'Edit Subtitle', 'scribe_subtitle_metabox', array( 'post', 'page' ), 'normal', 'high'); +function scribe_subtitle_meta() { + add_meta_box('scribe_subtitle_metabox', __( 'Edit Subtitle', 'scribe' ), 'scribe_subtitle_metabox_callback', array( 'post', 'page' ), 'normal', 'high'); } -add_action( 'add_meta_boxes', 'scribe_subtitle' ); +add_action( 'add_meta_boxes', 'scribe_subtitle_meta' ); -function scribe_subtitle_metabox() { - global $post; +/** + * Save post metadata when a post is saved. + * + * @param obj $post The post object. + */ +function scribe_subtitle_metabox_callback( $post ) { - wp_nonce_field( plugin_basename( __FILE__ ), 'scribe_subtitle_nonce' ); ## Create nonce + // Create nonce + wp_nonce_field( basename( __FILE__ ), 'scribe_subtitle_nonce' ); + + // Get the subtitle + $scribe_stored_meta = get_post_meta( $post->ID ); ?> - $subtitle = get_post_meta($post->ID, 'sub_title', true); ## Get the subtitle - ?>

- +

+ ID )) { - return $post->ID; + // Exits script depending on save status + if ( $is_autosave || $is_revision || !$is_valid_nonce ) { + return; } - if ( !wp_verify_nonce( $_POST['scribe_subtitle_nonce'], plugin_basename(__FILE__) )) { - - } else { - if($_POST['sub_title']) { - update_post_meta($post->ID, 'sub_title', $_POST['sub_title']); - } else { - update_post_meta($post->ID, 'sub_title', ''); - } + // Checks for input and sanitizes/saves if needed + if( isset( $_POST[ 'sub_title' ] ) ) { + update_post_meta( $post_id, 'sub_title', sanitize_text_field( $_POST[ 'sub_title' ] ) ); } - return false; } -add_action('save_post', 'scribe_subtitle_save_meta', 1, 2); +add_action( 'save_post', 'scribe_subtitle_save_meta' ); From a7db39d6460ba7b1bfeedc713a02d18870776331 Mon Sep 17 00:00:00 2001 From: Jami Gibbs Date: Fri, 10 Jun 2016 14:00:36 -0500 Subject: [PATCH 11/16] Removing custom meta box in favor of plugin --- README.md | 5 ++- customizer/styles.php | 2 +- functions.php | 5 --- inc/meta.php | 57 --------------------------------- readme.txt | 5 ++- scss/partials/_posts-pages.scss | 6 ++-- style.css | 10 +++--- template-parts/content-page.php | 5 --- template-parts/content.php | 9 ------ 9 files changed, 19 insertions(+), 85 deletions(-) delete mode 100644 inc/meta.php diff --git a/README.md b/README.md index db39711..08d52c6 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,10 @@ More information about child themes are available on [WordPress.org](https://cod **Does this theme support any plugins?** -Scribe includes support for Infinite Scroll in Jetpack. The theme will work out of the box without needing to activate any plugins though. +Scribe includes support for Infinite Scroll in [Jetpack](https://wordpress.org/plugins/jetpack/). +To enable subtitles on posts and pages, install the [Subtitles](https://wordpress.org/plugins/subtitles/) plugin. + +All plugins are recommended and the theme will work out of the box. ### Roadmap diff --git a/customizer/styles.php b/customizer/styles.php index 6fb2c84..de902c0 100644 --- a/customizer/styles.php +++ b/customizer/styles.php @@ -75,7 +75,7 @@ function scribe_customize_css() color: ; } - .featured-bg-image h3.subtitle { + .featured-bg-image .entry-subtitle { color: ; } diff --git a/functions.php b/functions.php index 9ecbaf4..f881cfb 100644 --- a/functions.php +++ b/functions.php @@ -165,8 +165,3 @@ function scribe_scripts() { * Load Jetpack compatibility file. */ require get_template_directory() . '/inc/jetpack.php'; - -/** - * Load Meta file. - */ -require get_template_directory() . '/inc/meta.php'; diff --git a/inc/meta.php b/inc/meta.php deleted file mode 100644 index f2fb0a4..0000000 --- a/inc/meta.php +++ /dev/null @@ -1,57 +0,0 @@ -ID ); ?> - -

- - -

- - ', '' ); - - $subtitle = get_post_meta(get_the_ID(), 'sub_title', true); - if( isset($subtitle) ) { - echo '

' . esc_attr( $subtitle ) . '

'; - } ?> diff --git a/template-parts/content.php b/template-parts/content.php index 12c8132..626450c 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -34,11 +34,6 @@ the_title( '

', '

' ); } - $subtitle = get_post_meta(get_the_ID(), 'sub_title', true); - if( isset($subtitle) ) { - echo '

' . esc_attr( $subtitle ) . '

'; - } - if ( 'post' === get_post_type() ) : ?>