Initial commit

This commit is contained in:
Matt Marcha 2023-11-25 15:33:01 +13:00
commit f8580e55df
11 changed files with 317 additions and 0 deletions

14
functions.php Normal file
View file

@ -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';

43
inc/cleanup.php Normal file
View file

@ -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; } );

7
parts/footer.html Normal file
View file

@ -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 -->

10
parts/header.html Normal file
View file

@ -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 -->

10
style.css Normal file
View file

@ -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
*/

9
templates/404.html Normal file
View file

@ -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"} /-->

26
templates/archive.html Normal file
View file

@ -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"} /-->

32
templates/index.html Normal file
View file

@ -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"} /-->

17
templates/page.html Normal file
View file

@ -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"} /-->

21
templates/single.html Normal file
View file

@ -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"} /-->

128
theme.json Normal file
View file

@ -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"
}
]
}