Skip to content

Commit

Permalink
Change header and footer templates
Browse files Browse the repository at this point in the history
  • Loading branch information
itsamoreh committed Nov 7, 2023
1 parent c093bb5 commit eccd589
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 42 deletions.
32 changes: 2 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ This is a barebones WordPress block theme starter. Use it to build your next blo

1. Make sure you're on node version `18.12.1` or later.
1. Run `npm install` from this directory to install dependencies.
1. Run `npm run watch` to watch [CSS](#css), [JavaScript](#editor-and-frontend-javascript),
and [Custom Blocks](#custom-blocks).
1. Optionally follow the [local environment](#optional-local-environment)
1. Run `npm run watch` to watch [CSS](#css), and [JavaScript](#editor-and-frontend-javascript).
1. Optionally follow the [local environment](#optional-local-environment)
instructions below to spin up a wp-env environment.

## CSS
Expand Down Expand Up @@ -56,33 +55,6 @@ terminal:
npm run watch:js
```

## Custom Blocks

This theme uses wp-scripts to build custom Gutenberg blocks. Add your custom
blocks in the `blocks/` directory. Each block should have its own directory.

To build the blocks, run the following command in your terminal:

```bash
npm run build:blocks
```

This will take all of your blocks inside `blocks/`, build them with wp-scripts
and output them to `build/blocks/` directory. Make sure to enqueue the built
blocks in the theme like this:

```php
// functions.php
include get_template_directory() . '/build/blocks/block-name/index.php';
```

To watch for changes to your blocks and automatically rebuild, run the following
command in your terminal:

```bash
npm run watch:blocks
```

## Optional Local Environment

This theme includes a `.wp-env.json`. To spin up a WordPress environment with
Expand Down
Binary file added assets/images/Am.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Place any images you want to use in the theme here. If you need to use them in
patterns or templates, use the `get_theme_file_uri()` function like this:

```php
<img src="<?php echo esc_url( get_theme_file_uri( 'assets/images/logo.png' ) ) ?>" width="60" height="60"/>
<img src="<?php echo esc_url( get_theme_file_uri( 'assets/images/Am.png' ) ) ?>" width="60" height="60"/>
```
Binary file removed assets/images/logo.png
Binary file not shown.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions patterns/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
*/
?>
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"48px","bottom":"48px"},"margin":{"top":"0"}},"elements":{"link":{"color":{"text":"var:preset|color|white"}}}},"backgroundColor":"black","textColor":"white","layout":{"type":"constrained"},"fontSize":"x-small"} -->
<div class="wp-block-group alignfull has-white-color has-black-background-color has-text-color has-background has-link-color has-x-small-font-size" style="margin-top:0;padding-top:48px;padding-bottom:48px"><!-- wp:group {"align":"wide","style":{"spacing":{"blockGap":"0px"}},"layout":{"type":"flex","allowOrientation":false,"justifyContent":"space-between"}} -->
<div class="wp-block-group alignwide"><!-- wp:image {"id":49,"width":60,"height":60,"sizeSlug":"full","linkDestination":"custom"} -->
<figure class="wp-block-image size-full is-resized"><a href="/"><img src="<?php echo esc_url( get_theme_file_uri( 'assets/images/logo.png' ) ) ?>" alt="" class="wp-image-49" width="60" height="60"/></a></figure>
<div class="wp-block-group alignfull has-white-color has-black-background-color has-text-color has-background has-link-color has-x-small-font-size" style="margin-top:0;padding-top:48px;padding-bottom:48px"><!-- wp:group {"style":{"spacing":{"blockGap":"0px"}},"layout":{"type":"flex","allowOrientation":false,"justifyContent":"space-between"}} -->
<div class="wp-block-group"><!-- wp:image {"id":21,"width":"60px","sizeSlug":"full","linkDestination":"custom","className":"is-resized"} -->
<figure class="wp-block-image size-full is-resized"><a href="/"><img src="<?php echo esc_url( get_theme_file_uri( 'assets/images/Am.png' ) ); ?>" alt="" class="wp-image-21" style="width:60px"/></a></figure>
<!-- /wp:image -->

<!-- wp:navigation {"ref":26} /--></div>
<!-- /wp:group --></div>
<!-- wp:navigation {"ref":22,"overlayMenu":"never"} /--></div>
<!-- /wp:group -->

<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center">© <?php echo esc_html( date("Y") ); ?> Amor Kumar</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->
10 changes: 5 additions & 5 deletions patterns/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
*/
?>
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"32px","bottom":"32px","right":"24px","left":"24px"},"margin":{"top":"0px"}},"position":{"type":"sticky","top":"0px"}},"className":"site-header","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull site-header" style="margin-top:0px;padding-top:32px;padding-right:24px;padding-bottom:32px;padding-left:24px"><!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between","flexWrap":"nowrap","orientation":"horizontal"}} -->
<div class="wp-block-group alignwide"><!-- wp:image {"id":49,"width":60,"sizeSlug":"full","linkDestination":"custom"} -->
<figure class="wp-block-image size-full is-resized"><a href="/"><img src="<?php echo get_theme_file_uri( 'assets/images/logo.png' ); ?>" alt="" class="wp-image-49" width="60"/></a></figure>
<div class="wp-block-group alignfull site-header" style="margin-top:0px;padding-top:32px;padding-right:24px;padding-bottom:32px;padding-left:24px"><!-- wp:group {"layout":{"type":"flex","justifyContent":"space-between","flexWrap":"nowrap","orientation":"horizontal"}} -->
<div class="wp-block-group"><!-- wp:image {"id":21,"width":"60px","aspectRatio":"1","sizeSlug":"full","linkDestination":"custom"} -->
<figure class="wp-block-image size-full is-resized"><a href="/"><img src="<?php echo esc_url( get_theme_file_uri( 'assets/images/Am.png' ) ); ?>" alt="" class="wp-image-21" style="aspect-ratio:1;width:60px"/></a></figure>
<!-- /wp:image -->

<!-- wp:navigation {"ref":26} /--></div>
<!-- wp:navigation {"ref":22,"overlayMenu":"never"} /--></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
<!-- /wp:group -->

0 comments on commit eccd589

Please sign in to comment.