commit f8580e55df650cd71613fa0ea58a9a3e22740025 Author: Matt Marcha <matt@marcha.pro> Date: Sat Nov 25 15:33:01 2023 +1300 Initial commit diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..d5fcee2 --- /dev/null +++ b/functions.php @@ -0,0 +1,14 @@ +<?php +/** +* Functions and definitions +* +* @link https://developer.wordpress.org/themes/basics/theme-functions/ - functions.php documentation +* +* @package EcoWP\Functions +* @since 0.1 +*/ + +/** + * Disable unnecessary features + */ +require get_template_directory() . '/inc/cleanup.php'; diff --git a/inc/cleanup.php b/inc/cleanup.php new file mode 100644 index 0000000..086f9fe --- /dev/null +++ b/inc/cleanup.php @@ -0,0 +1,43 @@ +<?php +/*** + * Removal of all unwanted features + * + * @package EcoWP\Functions\Cleanup + * @since 0.1 + */ + +/*** + * Hook on init to remove some supports and functionalities + * + */ +add_action( 'init',function(){ + // Remove tag for posts + unregister_taxonomy_for_object_type( 'post_tag', 'post' ); + + // Remove unwanted supports + remove_post_type_support('post', 'author'); + remove_post_type_support('page', 'author'); + remove_post_type_support('post', 'comments'); + remove_post_type_support('page', 'comments'); + remove_post_type_support('post', 'trackbacks'); + remove_post_type_support('page', 'trackbacks'); +}); + +// Removal of pre-made patterns +remove_theme_support( 'core-block-patterns' ); + +/*** + * Removal of search feature + * + */ +function matt_filter_query( $query, $error = true ) { + if ( is_search() ) { + $query->is_search = false; + $query->query_vars['s'] = false; + $query->query['s'] = false; + if ( $error ) + $query->is_404 = true; + } +} +add_action( 'parse_query', 'matt_filter_query' ); +add_filter( 'get_search_form', function () { return null; } ); \ No newline at end of file diff --git a/parts/footer.html b/parts/footer.html new file mode 100644 index 0000000..a02ecad --- /dev/null +++ b/parts/footer.html @@ -0,0 +1,7 @@ +<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} --> +<div class="wp-block-group"><!-- wp:site-title {"level":0} /--> + + <!-- wp:paragraph --> + <p>© 2023 Owner. All rights reserved.</p> + <!-- /wp:paragraph --></div> +<!-- /wp:group --> \ No newline at end of file diff --git a/parts/header.html b/parts/header.html new file mode 100644 index 0000000..f92a112 --- /dev/null +++ b/parts/header.html @@ -0,0 +1,10 @@ +<!-- wp:group {"layout":{"type":"flex","flexWrap":"wrap","justifyContent":"space-between"}} --> +<div class="wp-block-group"> + <!-- wp:group {"layout":{"type":"flex","orientation":"vertical"}} --> + <div class="wp-block-group"> + <!-- wp:site-title {"textAlign":"center"} /--> + <!-- wp:site-tagline {"textAlign":"center"} /--></div> + <!-- /wp:group --> + + <!-- wp:navigation /--></div> +<!-- /wp:group --> \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..354aac0 --- /dev/null +++ b/style.css @@ -0,0 +1,10 @@ +/* +Theme Name: Eco FSE +Author: Matt Marcha +Description: A FSE version of the ecoWP theme +Version: 0.1 +Requires at least: 6.0 +Tested up to: 6.2 +Requires PHP: 8.1 +Text Domain: ecofse +*/ diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000..a51af9a --- /dev/null +++ b/templates/404.html @@ -0,0 +1,9 @@ +<!-- wp:template-part {"slug":"header", "tagName":"header"} /--> + +<!-- wp:group {"tagName":"main","layout":{"type":"constrained"}} --> +<main class="wp-block-group"> + +</main> +<!-- /wp:group --> + +<!-- wp:template-part {"slug":"footer", "tagName":"footer"} /--> \ No newline at end of file diff --git a/templates/archive.html b/templates/archive.html new file mode 100644 index 0000000..eab22eb --- /dev/null +++ b/templates/archive.html @@ -0,0 +1,26 @@ +<!-- wp:template-part {"slug":"header", "tagName":"header"} /--> + +<!-- wp:group {"tagName":"main","layout":{"type":"constrained"}} --> +<main class="wp-block-group"> + <!-- wp:query --> + <div class="wp-block-query"> + <!-- wp:post-template --> + <!-- wp:query-title {"type":"archive"} /--> + <!-- wp:term-description /--> + <!-- wp:post-featured-image /--> + <!-- wp:post-title {"isLink":true} /--> + <!-- wp:post-date /--> + <!-- wp:post-excerpt /--> + <!-- /wp:post-template --> + <!-- wp:query-pagination --> + <div class="wp-block-query-pagination"> + <!-- wp:query-pagination-previous /--> + <!-- wp:query-pagination-next /--> + </div> + <!-- /wp:query-pagination --> + </div> + <!-- /wp:query --> +</main> +<!-- /wp:group --> + +<!-- wp:template-part {"slug":"footer", "tagName":"footer"} /--> \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..d25d0dd --- /dev/null +++ b/templates/index.html @@ -0,0 +1,32 @@ +<!-- wp:template-part {"slug":"header", "tagName":"header"} /--> + +<!-- wp:group {"tagName":"main","layout":{"type":"constrained"}} --> +<main class="wp-block-group"> + <!-- wp:query --> + <div class="wp-block-query"> + <!-- wp:post-template --> + <!-- wp:post-featured-image /--> + <!-- wp:post-title {"isLink":true} /--> + <!-- wp:group {"layout":{"type":"flex","flexWrap":"wrap","justifyContent":"left"}} --> + <div class="wp-block-group"> + <!-- wp:post-date /--> + <!-- wp:paragraph --><p>⋅</p><!-- /wp:paragraph --> + <!-- wp:post-terms {"term":"category"} /--> + </div> + <!-- /wp:group --> + + + <!-- wp:post-excerpt /--> + <!-- /wp:post-template --> + <!-- wp:query-pagination --> + <div class="wp-block-query-pagination"> + <!-- wp:query-pagination-previous /--> + <!-- wp:query-pagination-next /--> + </div> + <!-- /wp:query-pagination --> + </div> + <!-- /wp:query --> +</main> +<!-- /wp:group --> + +<!-- wp:template-part {"slug":"footer", "tagName":"footer"} /--> \ No newline at end of file diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..eb124fe --- /dev/null +++ b/templates/page.html @@ -0,0 +1,17 @@ +<!-- wp:template-part {"slug":"header", "tagName":"header"} /--> + +<!-- wp:group {"tagName":"main","layout":{"type":"constrained"}} --> +<main class="wp-block-group"> + <!-- wp:query --> + <div class="wp-block-query"> + <!-- wp:post-template --> + <!-- wp:post-featured-image /--> + <!-- wp:post-title /--> + <!-- wp:post-content /--> + <!-- /wp:post-template --> + </div> + <!-- /wp:query --> +</main> +<!-- /wp:group --> + +<!-- wp:template-part {"slug":"footer", "tagName":"footer"} /--> \ No newline at end of file diff --git a/templates/single.html b/templates/single.html new file mode 100644 index 0000000..f5482c5 --- /dev/null +++ b/templates/single.html @@ -0,0 +1,21 @@ +<!-- wp:template-part {"slug":"header", "tagName":"header"} /--> + +<!-- wp:group {"tagName":"main","layout":{"type":"constrained"}} --> +<main class="wp-block-group"> + <!-- wp:query --> + <div class="wp-block-query"> + <!-- wp:post-template --> + <!-- wp:post-featured-image /--> + <!-- wp:post-title /--> + <!-- wp:post-date /--> + <!-- wp:post-content /--> + <!-- wp:spacer {"height":20} /--> + <!-- wp:post-navigation-link {"type":"previous"} /--> + <!-- wp:post-navigation-link /--> + <!-- /wp:post-template --> + </div> + <!-- /wp:query --> +</main> +<!-- /wp:group --> + +<!-- wp:template-part {"slug":"footer", "tagName":"footer"} /--> \ No newline at end of file diff --git a/theme.json b/theme.json new file mode 100644 index 0000000..fde5b1b --- /dev/null +++ b/theme.json @@ -0,0 +1,128 @@ +{ + "$schema": "https://schemas.wp.org/trunk/theme.json", + "version": 2, + "settings": { + "layout": { + "contentSize": "720px", + "wideSize": "900px" + }, + "color": { + "custom": false, + "customGradient": false, + "customDuotone": false, + "background": true, + "text": true, + "link": true, + "defaultPalette": false, + "defaultDuotone": false, + "defaultGradients": false, + "palette": [ + { + "slug": "primary", + "color": "#ff9d00", + "name": "Primary" + }, + { + "slug": "secondary", + "color": "#de5357", + "name": "Secondary" + }, + { + "slug": "tertiary", + "color": "#0087b0", + "name": "Tertiary" + }, + { + "slug": "quaternary", + "color": "#28185d", + "name": "Quaternary" + } + ], + "gradients": [ + { + "slug": "primary-to-secondary", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--primary), var(--wp--preset--color--secondary))", + "name": "Primary to Secondary" + } + ], + "duotone": [ + { + "colors": [ "var(--wp--preset--color--primary)", "var(--wp--preset--color--secondary)" ], + "slug": "primary-and-secondary", + "name": "Primary and secondary" + } + ] + }, + "typography": { + "fontFamilies": [ + { + "fontFamily": "Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif", + "slug": "neo-grotesque", + "name": "Neo-Grotesque" + }, + { + "fontFamily": "Avenir, Montserrat, Corbel, 'URW Gothic', source-sans-pro, sans-serif", + "slug": "geometric-humanist", + "name": "Geometric Humanist" + }, + { + "fontFamily": "Didot, 'Bodoni MT', 'Noto Serif Display', 'URW Palladio L', P052, Sylfaen, serif", + "slug": "didone", + "name": "Didone" + } + ], + "fontSizes": [ + { + "slug": "medium", + "size": "1rem", + "name": "Medium" + }, + { + "slug": "small", + "size": "0.8rem", + "name": "Small" + }, + { + "slug": "large", + "size": "1.5rem", + "name": "Large" + }, + { + "slug": "extra-large", + "size": "2rem", + "name": "Extra large" + } + ] + } + }, + "styles": { + "color": { + "background": "FFF", + "text": "#222" + }, + "elements": { + "link": { + "color": { + "text": "var(--wp--preset--color--primary)" + } + } + }, + "typography": { + "fontSize": "var(--wp--preset--font-size--medium)", + "fontFamily": "var(--wp--preset--font-family--neo-grotesque)", + "lineHeight": "1.3" + } + }, + "templateParts": [ + { + "name": "header", + "area": "header", + "title": "Header" + }, + { + "name": "footer", + "area": "footer", + "title": "Footer" + } + ] +} \ No newline at end of file