From 0c9de62831b61bd32369ef450b4e2dc59ec6c326 Mon Sep 17 00:00:00 2001 From: Adam Piontek Date: Sat, 10 Jul 2021 17:13:24 -0400 Subject: [PATCH] working: footer widgets, searchform, search results --- 404.php | 2 +- README.md | 2 +- TODO.md | 20 +++++----- assets/css/_bs-colors.scss | 16 ++++---- assets/css/_bs-custom.scss | 10 ++++- assets/css/app.scss | 64 ++++++++++++++++++++++++++++++-- assets/js/main.js | 3 +- comments.php | 2 +- footer.php | 55 +++++++++++++++++++++++++--- front-page.php | 2 +- header.php | 14 ++++++- index.php | 20 ++++------ search.php | 75 ++++++++++++++------------------------ searchform.php | 27 ++++++++++++++ sidebar.php | 16 -------- src/classes.php | 15 +++++++- src/sidebars.php | 12 +++--- 17 files changed, 234 insertions(+), 121 deletions(-) create mode 100644 searchform.php delete mode 100644 sidebar.php diff --git a/404.php b/404.php index f80e994..b6abf3c 100644 --- a/404.php +++ b/404.php @@ -4,7 +4,7 @@ * * @link https://codex.wordpress.org/Creating_an_Error_404_Page * - * @package Freeshifter + * @package AdamPion73k */ get_header(); ?> diff --git a/README.md b/README.md index 97f518d..6f5c544 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The WordPress theme for 73k.us, based on Bootstrap 5 and PurgeCSS. - [Composer](https://getcomposer.org) ## How to get started -1. Clone or [download](https://github.com/freeshifter/wp-73k/archive/master.zip "Download the WP Tailwind Zip") the project onto your `themes` directory `(./wp-content/themes)` +1. Clone or [download](https://github.com/AdamPion73k/wp-73k/archive/master.zip "Download the WP Tailwind Zip") the project onto your `themes` directory `(./wp-content/themes)` 2. Run a find/replace for the following strings: - `wp-73k` - `WP_73k` diff --git a/TODO.md b/TODO.md index e048417..8adb63e 100644 --- a/TODO.md +++ b/TODO.md @@ -34,16 +34,15 @@ - [X] ~~*SYNTAX HIGHLIGHTING PLUGIN*~~ [2021-07-10] - [X] ~~*wrapping lines now? how to ensure nowrap?*~~ [2021-07-10] - [X] ~~*add remaining content*~~ [2021-07-10] -- [ ] blog pagination? -- [ ] footer 'sidebar' (blog-only)? - - [ ] date archives? - - [ ] tag archives? - - [ ] search? - - [ ] meta? etc? - - [ ] sidebar.php ?? -- [ ] search field up top somewhere? - - [ ] search.php ?? -- [ ] comments.php & article post handling (form, styling, etc?) +- [X] ~~*blog pagination?*~~ [2021-07-10] +- [X] ~~*footer 'sidebar' (blog-only)?*~~ [2021-07-10] + - [X] ~~*date archives?*~~ [2021-07-10] + - [X] ~~*tag archives?*~~ [2021-07-10] + - [X] ~~*search?*~~ [2021-07-10] + - [X] ~~*meta? etc?*~~ [2021-07-10] + - [X] ~~*sidebar.php ??*~~ [2021-07-10] +- [X] ~~*search field up top somewhere?*~~ [2021-07-10] + - [X] ~~*search.php ??*~~ [2021-07-10] - [ ] 404.php - [ ] NGINX SNIPPETS - bring in for testing! - [ ] nginx 404 handling? @@ -58,6 +57,7 @@ - [ ] jetpack? markdown from that one? - [ ] caching? lighthouse report (cat-roof webp, woff2 fonts) - [ ] [info](https://wordpress.org/support/article/optimization/#browser-caching) +- [ ] comments.php & article post handling (form, styling, etc?) - [ ] comments? discussion? - [ ] indieweb stuff? - [ ] use wordpress for filebrowser login auth? diff --git a/assets/css/_bs-colors.scss b/assets/css/_bs-colors.scss index 0e360c7..a7c3642 100644 --- a/assets/css/_bs-colors.scss +++ b/assets/css/_bs-colors.scss @@ -1,9 +1,10 @@ // Colors -$primary: #e48663; -$secondary: #00b0b0; -$success: #99c24d; -$info: #b489c7; -$warning: #f4d35e; +// -- now defined in bs-custom -- +// $primary: #e48663; +// $secondary: #00b0b0; +// $success: #99c24d; +// $info: #b489c7; +// $warning: #f4d35e; $white: #fff; $gray-100: #e8e8e8; @@ -35,10 +36,6 @@ $custom-colors: ( "gray-dark": $gray-800, ); -// $custom-colors: ( -// "custom-color": #900 -// ); - // Merge the maps $theme-colors: map-merge($theme-colors, $custom-colors); @@ -48,3 +45,4 @@ $navbar-dark-hover-color: rgba($white, 0.9); $navbar-dark-active-color: $white; $navbar-dark-disabled-color: rgba($white, 0.45); $navbar-dark-toggler-border-color: rgba($white, 0.3); +$component-active-bg: $primary; diff --git a/assets/css/_bs-custom.scss b/assets/css/_bs-custom.scss index 2b5658e..7f18eda 100644 --- a/assets/css/_bs-custom.scss +++ b/assets/css/_bs-custom.scss @@ -1,7 +1,7 @@ /* Bootstrap custom variable overrides */ // Typography -$font-size-base: 1.1rem; +$font-size-base: 1.125rem; $font-family-serif: "Source Serif Pro", "Iowan Old Style", "Apple Garamond", Baskerville, "Times New Roman", "Droid Serif", Times, serif, @@ -19,3 +19,11 @@ $font-family-base: $font-family-serif; // Features $enable-shadows: true; $enable-negative-margins: true; + +// init colors for some vars +$primary: #e48663; +$secondary: #00b0b0; +$success: #99c24d; +$info: #b489c7; +$warning: #f4d35e; +$component-active-bg: $secondary; diff --git a/assets/css/app.scss b/assets/css/app.scss index 2bac966..c05d95a 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -88,8 +88,11 @@ a { .fs-smaller { font-size: smaller; } -.footer73k { - position: fixed !important; +.tek-fixed-footer { + @extend .bg-dark; + @extend .bottom-0; + @extend .end-0; + @extend .position-fixed; font-size: 14px !important; border-top-left-radius: 0.3rem !important; padding-top: 2px; @@ -100,7 +103,7 @@ a { @extend .font-monospace; @extend .text-gray-300; @extend .mb-0; - margin-top: -0.5rem; + // margin-top: -0.5rem; } .tek-border-bottom-gray-dashed { @extend .border-bottom; @@ -234,4 +237,59 @@ blockquote { } .more-link { @extend .fs-6; +} + +/* widget styling */ +#footer-widgets { + background-color: $gray-750; + border-radius: .5em; + .widgettitle { + @extend .fs-4; + } + .wp-block-group { + @extend .px-3; + @extend .py-3; + max-width: 25rem; + } + .wp-block-loginout { + display: list-item; + margin-left: 2rem; + list-style-type: disc; + } +} +.wp-block-tag-cloud { + @extend .mb-0; +} +.search-form .form-control { + color: $gray-100 !important; + background-color: $gray-800 !important; + border-color: $gray-500; +} +.search-form .form-control:focus { + border-color: $input-focus-border-color; +} +.form-control::-webkit-input-placeholder { /* WebKit, Blink, Edge */ + color: $gray-500 !important; +} +.form-control:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ + color: $gray-500 !important; + opacity: 1; +} +.form-control::-moz-placeholder { /* Mozilla Firefox 19+ */ + color: $gray-500 !important; + opacity: 1; +} +.form-control:-ms-input-placeholder { /* Internet Explorer 10-11 */ + color: $gray-500 !important; +} +.form-control::-ms-input-placeholder { /* Microsoft Edge */ + color: $gray-500 !important; +} +.form-control::placeholder { /* Most modern browsers support this now. */ + color: $gray-500 !important; +} +.search-form .btn-outline-light:hover { + color: $primary; + background-color: inherit; + border-color: $secondary; } \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js index 27e9e53..96ba7a5 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -14,8 +14,7 @@ import "../../node_modules/@mdi/svg/svg/typewriter.svg"; import "../../node_modules/@mdi/svg/svg/calendar-clock.svg"; import "../../node_modules/@mdi/svg/svg/tag-multiple.svg"; import "../../node_modules/@mdi/svg/svg/rss.svg"; -import "../../node_modules/@mdi/svg/svg/account-hard-hat.svg"; -import "../../node_modules/@mdi/svg/svg/open-in-new.svg"; +import "../../node_modules/@mdi/svg/svg/magnify.svg"; // social import "../../node_modules/@mdi/svg/svg/linkedin.svg"; import "../../node_modules/@mdi/svg/svg/github.svg"; diff --git a/comments.php b/comments.php index cc77d03..3e5d784 100644 --- a/comments.php +++ b/comments.php @@ -7,7 +7,7 @@ * * @link https://codex.wordpress.org/Template_Hierarchy * - * @package Freeshifter + * @package AdamPion73k */ /* diff --git a/footer.php b/footer.php index fa84c36..b7c9089 100644 --- a/footer.php +++ b/footer.php @@ -6,18 +6,61 @@ * * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials * - * @package Freeshifter + * @package AdamPion73k */ namespace WP_73k; ?> - + + + + + + + + + diff --git a/front-page.php b/front-page.php index 249ca35..e2f4b23 100644 --- a/front-page.php +++ b/front-page.php @@ -33,4 +33,4 @@ get_header('', array('fixednav'=>true)); ?> true)); diff --git a/header.php b/header.php index 67e8fc7..28b62b3 100644 --- a/header.php +++ b/header.php @@ -6,7 +6,7 @@ * * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials * - * @package Freeshifter + * @package AdamPion73k */ namespace WP_73k; @@ -75,6 +75,12 @@ namespace WP_73k; diff --git a/index.php b/index.php index 3ec8800..7e871ef 100644 --- a/index.php +++ b/index.php @@ -12,16 +12,16 @@ get_header(); ?>
- +

- - - - - -
false)); diff --git a/search.php b/search.php index 0eb102b..461e25f 100644 --- a/search.php +++ b/search.php @@ -4,63 +4,42 @@ * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result * - * @package Freeshifter + * @package AdamPion73k */ get_header(); ?> -
-
+
+
+ + +

+ Search results for:

+ - printf( '

Search Results for: %s

', - esc_html( get_search_query() ) - ); + - echo '
'; - while ( have_posts() ) { - the_post(); ?> - ', - get_the_excerpt() - ); ?> - - -
- '; + Search: nothing found'; - else : + printf( 'Sorry, no results for %s', + esc_html( get_search_query() ) + ); + endif; + ?> - printf( 'Sorry, no results for %s', - esc_html( get_search_query() ) - ); - - endif; ?> -
+
- false)); diff --git a/searchform.php b/searchform.php new file mode 100644 index 0000000..7a78f98 --- /dev/null +++ b/searchform.php @@ -0,0 +1,27 @@ + +
method="get" class="search-form flex-fill flex-sm-grow-0" action=""> +
+ + + +
+
diff --git a/sidebar.php b/sidebar.php deleted file mode 100644 index f46c493..0000000 --- a/sidebar.php +++ /dev/null @@ -1,16 +0,0 @@ - - - diff --git a/src/classes.php b/src/classes.php index 5330433..9d3fb16 100644 --- a/src/classes.php +++ b/src/classes.php @@ -80,4 +80,17 @@ add_filter( 'document_title_separator', function ( $separator ) { } ); add_filter('document_title_parts', function ($title) { return (is_home() || is_front_page()) ? $title : array_reverse($title); -}); \ No newline at end of file +}); + + +/** + * Exclude pages from WordPress Search + */ +if (!is_admin()) { + add_filter('pre_get_posts',function($query) { + if ($query->is_search) { + $query->set('post_type', 'post'); + } + return $query; + }); +} \ No newline at end of file diff --git a/src/sidebars.php b/src/sidebars.php index 797fc2f..2997c6d 100644 --- a/src/sidebars.php +++ b/src/sidebars.php @@ -8,13 +8,11 @@ namespace WP_73k; add_action( 'widgets_init', function () { register_sidebar( [ - 'name' => esc_html( 'Sidebar' ), - 'id' => 'sidebar', - 'description' => '', - 'before_widget' => '
', - 'after_widget' => '
', - 'before_title' => '

', - 'after_title' => '

', + 'name' => esc_html( 'Footer' ), + 'id' => 'footer-widgets', + 'description' => 'Blog page footer area for widgets', + 'before_widget' => '
', + 'after_widget' => '
', ] ); } ); \ No newline at end of file