Giter VIP home page Giter VIP logo

sb's Introduction

SB

screenshot

Description

SB is a Full Site Editing (FSE) theme with Gutenberg blocks.

The "Second Byte" theme is required to replace the "Specially Built" Genesis-SB theme that is used in seriouslybonkers.com.

Requirements:

  1. Implement Full Site Editing.
  2. Similar look and feel as the Genesis-SB theme.
  3. Find out what bits are missing from and/or not working in Gutenberg FSE.
  4. Implement on seriouslybonkers.com when stable.

Contents:

IMPLEMENTED:

The templates developed so far are:

  • 404.html - Not found page
  • index.html - default template when no others found
  • page-sb.html - Custom template for the react-SB page
  • page-submit-bigram.html - Custom template for the Submit Bigram page
  • singular-one-column.html - Custom template for one column main content, with sidebar
  • singular.html - Single bigram page

The parts are:

  • 404-body.html - Not found main content
  • 404.html - Not found main content and sidebar
  • body-and-sidebar.html - main content and sidebar
  • footer.html - Final full width footer
  • header.html - Displays the header: site logo, site title and tagline and search box
  • home-body.html - the main content - still under construction
  • main-menu.html - the primary navigation menu
  • metadates.html - post date and last update date
  • one-column-and-sidebar.html - custom template part
  • one-column.html - one column featured image and content
  • page-footer.html - 3 column footer widgets
  • post-author.html - styled post author block for singular
  • search-banter.html - search banter for the search template
  • sequentially-biased.html - sidebar widget
  • sidebar.html - sidebar widgets - under construction
  • singular-and-sidebar.html - main content and sidebar
  • singular.html - main content for singular
  • site-building.html - sidebar widget
  • social-links.html - at the bottom of the footer
  • structured-breakdown.html - first widget in the sidebar
  • summed-by.html - sidebar widget

home-body.html consists of three query blocks which are overriden in server side rendering to deliver:

  • Hero section - query block to display the first bigram for the page
  • Thumbnail section - up to 4 groups of 4 featured images displayed in a grid
  • Links section -query block to display links to other posts

followed by a pagination section.

NOT NECESSARY:

The following templates were planned but deemed to be unnecessary since index.html satisfies the requirements except perhaps for a breadcrumbs block.

  • archive.html - generic template used for archives: author, taxonomy, date, tag

  • category.html - used to display the Category archive

  • date.html - date base archive

  • home.html - used for Blog Posts index page or Posts Shown on Front (when front-page not implemented)

  • taxonomy.html - used to display taxonomy terms

  • See the template visualization: https://developer.wordpress.org/files/2014/10/Screenshot-2019-01-23-00.20.04.png

Installation

  • Install and activate pre-requisite plugins.

  • Either install Gutenberg 13.1.0 or higher or install and build the latest Gutenberg source.

  • Activate Gutenberg.

  • Install and activate the SB theme, as you would install any other theme. Full Site Editing will be enabled automatically.

  • For some of the templates and template parts to work properly you will need to install and activate the pre-requisite plugins.

  • For templates which include navigation blocks you will need to edit the supplied menus.

  • Pre-requisite plugins: see also Notes

  • oik

  • oik-fields

  • oik-a2z

  • sb-breadcrumbs-block

  • bigram

Change Log

0.5.0

  • Changed: Display up to 32 bigrams with thumbnails #38
  • Changed: Move paragraph styling to css/paragraph-aiprompt.css #38
  • Changed: Enqueue stylesheets for paragraph #38
  • Changed: Make the background colour a little lighter #38
  • Changed: Add is-style-revisedprompt #38
  • Changed: Adjust home page hero layout #38

0.4.0

  • Changed: Add AI prompt and response. Adjust featured image for singular.html #37
  • Tested: With WordPress 6.4.2
  • Tested: With Gutenberg 17.2.3
  • Tested: With PHP 8.0, 8.1, 8.2 and 8.3

0.3.2

  • Changed: Support PHP 8.1, PHP 8.2 and PHP 8.3 #36
  • Tested: With WordPress 6.4.1
  • Tested: With Gutenberg 17.1.4
  • Tested: With PHP 8.0, 8.1, 8.2 and 8.3

0.3.1

  • Changed: Restructure metadates for better display on narrow devices #33
  • Changed: Prevent Site building menu from switching to hamburger on mobile #33
  • Changed: Add margin for narrow devices #33
  • Tested: With Gutenberg 13.8.1

0.3.0

  • Changed: Cater for Gutenberg not activated #34
  • Changed: Wrap shortcodes in a block #35
  • Changed: Fix drop down menu styling wrapping issues #33
  • Tested: With WordPress 6.0.1
  • Tested: With PHP 8.0

0.2.1

  • Changed: Remove unnecessary query-no-results block #32
  • Changed: Reduce work done in genesis_sb_the_posts() #32
  • Added: Override navigation-link block #30
  • Tested: With WordPress 5.9.3
  • Tested: With PHP 8.0
  • Tested: With Gutenberg 13.1.0

0.2.0

  • Added: Add Published, Last Updated and (Edit) link to hero post #1
  • Added: Add bigram/search-banter in search-banter template part for body-and-sidebar #24
  • Added: Add custom template singular-one-column.html #27
  • Added: Add page-sb template #25
  • Added: Add page-submit-bigram #27
  • Added: Implement 404.html template #22
  • Changed: Add $content and $block params to sb_render_block_core_template_part
  • Changed: Add menu to Info widget area
  • Changed: Add spacer before post-author. Set avatarSize to 70 pixels #19
  • Changed: Added query title and breadcrumbs blocks #1
  • Changed: Cater for changes in Gutenberg 12.3.0 #13
  • Changed: Docblock #19
  • Changed: Eliminate comma separator between post terms #20
  • Changed: Fix layout for second and third query blocks #13
  • Changed: Implement full main-menu #21
  • Changed: Improve menu styling #21
  • Changed: Improve page-footer layout. #1
  • Changed: Improve styling of vertical menus #23
  • Changed: Improve the Hero post entry-footer layout #1
  • Changed: Make menu behave a bit better
  • Changed: Override the post-author block #19
  • Changed: Put featured image and post title/content in 2 columns. Refactor pagination
  • Changed: Refactor experimental-theme.json to theme.json #17
  • Changed: Refactor home-body.html for Gutenberg 13.1.0
  • Changed: Refactor query-loop to post-template #16
  • Changed: Refactor query-loop to post-template #16.
  • Changed: Remove commented out code #13
  • Changed: Rename block-templates and block-template-parts #26
  • Changed: Replace bw_field _seen_before with bigram/seen-before #10
  • Changed: Replace hardcoded debug with sb-debug-block
  • Changed: Restyle the home page. Lose the hovering stuff in the middle section. Adjust font weights
  • Changed: Rework metadates as row with outer group #20
  • Changed: Rework singular for better alignment #20
  • Changed: Set shouldSyncIcon attribute for site-logo #1
  • Changed: Set tagName to aside to enable styling
  • Changed: Singular template with metadates and post-author template parts #20
  • Changed: Style metadates using flex. Style tags to look like tags. #20
  • Changed: Style the pagination for the main query #15
  • Changed: Update navigation block attributes
  • Changed: set theme.json version to 2. Set blockGap to 0 pixels
  • Fixed: bigram issue #21

0.1.0

  • Added: Implement server overrides for the 3 queries used on the home page,#13
  • Added: Initial pagination block for the home page,#13
  • Changed: Minor improvements to the 404.html template
  • Added: Improve sidebar and footer widget nav menus,#9
  • Changed: Reduce CSS for the main nav menu,#9
  • Added: Add the additional 3 widgets as separate template parts in the sidebar template part,#1
  • Changed: Improve styling,#1
  • Fixed: Override gutenberg rendering; don't run wpautop on template parts,#5
  • Fixed: Override gutenberg rendering; cater for unregistered taxonomies,#7
  • Fixed: Correct CSS for displaying the div.WP_DEBUG
  • Tested: With Gutenberg source trunk 10.3.0-rc1
  • Tested: With WordPress 5.7 and WordPress Multi Site
  • Tested: With PHP 8.0

0.0.0

  • Added: Created the basic theme using new-empty-theme.php from WordPress/theme-experiments.,#1
  • Changed: Updated index.php to tell the user to use Gutenberg
  • Changed: Styled with a combination of experimental-theme.json and style.css
  • Changed: Copied/cobbled styling for the navigation menu and footer from Genesis-SB
  • Changed: Used the new method to define normal content and wide content width,#4
  • Changed: Used the new method to define the footer areas as full width
  • Fixed: Enable oik shortcodes to be able to use [guts] in the footer area
  • Changed: Use custom.css for styling DEBUG divs
  • Changed: Created/updated block templates and template parts from the latest versions in the Site Editor for testing elsewhere
  • Fixed: Workaround problem with link colour on headings by not setting it; it's not needed anyway.,#5
  • Tested: With Gutenberg source trunk somewhere between 10.2.1 and 10.3
  • Tested: With WordPress 5.7 and WordPress Multi Site
  • Tested: With PHP 8.0

Notes

The theme is designed for use on seriouslybonkers.com.

The CSS is minimal; just enough to make it look OK on my laptop and external monitor. Responsibility for responsive styling is left to Gutenberg / WordPress core functionality.

Block overrides

SB contains a number of overrides to Gutenberg server rendered blocks which don't behave the way I want.

  • core/post-template - overrides the query loop to implement multi part main query processing
  • core/post-author - Changes the author name to a link to Self Bio and implements SB links
  • core/template-part - handle recursion, don't call wpautop()
  • core/navigation-link - replaces hardcoded links with site_url()
  • core/tag-cloud - possibly unnecessarily overridden

References

See my articles on herbmiller.me:

For other articles see the Fizzie theme's readme

For some other FSE themes see WP-a2z FSE themes

Brief development history

SB was my second attempt at creating a Full Site Editing theme using Gutenberg. Hence the subtitle Second Byte.

I started creating it in March 2021 for the third call for testing for the #fse-outreach-experiment

It's now over a year since that call and I still haven't completed all the logic for the 404 page.

In some respects, even though it might have required fewer templates and templates parts than Fizzie, I reckoned SB would be harder to achieve than other FSE themes. This was primarily due to the PHP logic for the home page, which I imagined would be more than tricky to implement.

There was also logic for the search results, the seen before count and integration with react-SB.

BTW. The Seriously Bonkers site is a direct spin off from a fun distraction played by members of a development team on a project started 30 years ago called Silver Bullet.

It was my manager's idea to call the project Silver Bullet; he'd read No Silver Bullet and wanted to attempt to disprove the main premise. Our plan was to implement a complicated client-server solution using some advanced tools in far less time than originally estimated.

The Silver Bullet project itself didn't fail. But it wasn't completed either; the plug was pulled on the parent product.

We had a lot of fun on the project, and even more fun collecting the SB's that now make up the fascinating website.

Silver Bullet was being developed using bleeding edge technology. 31 years on Second Byte is "still bleeding".

Copyright

(C) Copyright Herb Miller, Bobbing Wide 2021- 2024

  • This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

sb's People

Contributors

bobbingwide avatar

Watchers

 avatar  avatar

sb's Issues

Add Seen before: field which auto-increments when the post has been viewed

In the Genesis-SB theme the "Seen before" field displays the value of the post meta field called _seen_before.
This field is auto-incremented each time the post is viewed individually.

image

I need to replicate this logic in SB.
I imagine this will have to be implemented as a new block.
It'll give me the opportunity to learn how to access post meta data.

Note: In my first attempt to simply display the current value of the field nothing is being shown for the [bw_field _seen_before] shortcode.

Investigate reducing processing in the `genesis_sb_the_posts filter()` function for `the_posts`

This is a follow on issue related to #31 where I wrote

It's not so easy to reduce the amount of work that the filter function has to do for other queries.

  • Checking for is_main_query() is useless; every query is considered the main query.
  • One tiny improvement is to only call get_post_thumbnail_id when the post is a bigram.
  • Investigating what the actual query is doing is prone to error due to increased complexity.

Looking at the trace output for each invocation of the genesis_sb_the_posts() filter function, which is called 22 times on the
home page, we can see

  • a number of queries which don't need to be filtered.
  • and others which shouldn't have been needed in the first place

Note: the_posts is invoked from WP_Query::get_posts(). It is preceded by many other filters including pre_get_posts, which is hooked into by bigram and oik-types to adjust the post types to be listed.

Queries that don't need to be filtered include queries for wp_template and wp_template_part: the FSE theme locating templates and template parts

The unnecessary query was invoked from gutenberg_render_block_core_query_no_results(), which is the server rendering for the wp:query-no-results block.
The saved queries output for this query is:

        [47] => Array

            [0] => (string) "SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  WHERE 1=1  AND ((wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' 
OR wp_posts.post_status = 'private')))  ORDER BY wp_posts.post_date DESC LIMIT 0, 1"
            [1] => (double) 0.00086402893066406
            [2] => (string) "require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('wp-includes/template-canvas.php'), get_the_block_template_html, do_blocks, render_block, WP_Block->render, sb_render_block_core_template_part, do_blocks, render_block, WP_Block->render, WP_Block->render, WP_Block->render, WP_Block->render, sb_render_block_core_template_part, do_blocks, render_block, WP_Block->render, WP_Block->render, gutenberg_render_block_core_query_no_results, WP_Query->__construct, WP_Query->query, WP_Query->get_posts"
            [3] => (double) 1652252151.8039
            [4] => Array

Style the Post Author block on the singular template

In genesis-SB the Post Author section is displayed below the post.

image

  • Self Bio links to the bigram/self-bio, which basically contains the same of the user's bio
  • The gravatar is a gravatar
  • The Bio is the user's bio and is passed through the_content filtering to create any SB links

Proposed solution

  • Implement a post-author.html template part that uses the post-author block or similar.
  • Override the post-author block to run the_content filter using bigram_the_content.
  • It would be nice if styling could be done using theme.json
  • Failing that wrap the post-author block in a group with a light grey background

Problems creating footer template part with Tag cloud and colours

In the Site Editor this first pass at the footer area seems reasonable.
image

But these are a number of problems.
This is what I see in the front end.
image

Problems

  1. Front end - Tag cloud in the front end is displayed with <br /> between each link - when formatted in a column.
  2. Editor -Tag cloud colour cannot be set
  3. Front end - White colour for the headings has not been respected
  4. Editor - Accidentally clicking on a tag cloud link leaves the Site Editor - changes not saved.
  5. Editor - Tag clouds only work for certain taxonomies
  6. Front end - Group block - no matter what I do it's always full width.

Remove block override dependency on Gutenberg

There are currently major performance problems attempting to use the Site Editor to edit the SB theme. See #6.

In order to determine what's causing these problems I want to be able to test the theme in multiple environments, with fewer activated plugins.

Requirement

The block override logic should work even when Gutenberg is not activated.

Proposed solution

I implemented this for Fizzie. Similar code will be needed in the block overrides for SB.

  1. The sb_maybe_override_block() function needed check the currently assigned render_callback function
  2. Each block override function that references a gutenberg_ prefixed function should test for its existence before calling it.

Updating failed! No templates exist with that id - and further observations

After deleting a template part using Move to trash the following error message was displayed.

Updating failed. No templates exist with that id.

Several problems here.

  1. I shouldn't have remained in the block editor after performing the delete.
  2. The message says "templates" not "template parts"
  3. What's "that id"?
  4. I clicked on Move to trash again. This time I got "No templates exist with that id."

In this example I was in the Code editor.
The template part had been deleted.

image

While attempting to recreate the problem in Visual editor mode:

  • the Move to trash button ran Updating
  • and then Post updated slid up from the bottom.
  • the template part had not been NOT deleted

Replicate Genesis-SB logic to display posts on the home page and archives using 3 different layouts

In the Genesis-SB theme the home page and certain archive pages display the result of the main query in three parts.

  • Hero
  • Thumbnail grid - up to 4 by 4
  • Links section

followed by a pagination block.

60 bigrams are displayed per page.

The logic I need to replicate includes a routine to rearrange the posts per page so that those with a Featured image come first.
This is genesis_sb_the_posts( $posts, $query ) which is hooked into the_posts. It's run on every page.

Note: I assume there'll be at least one featured image in a block of 60 bigrams.

Then in the loop to display the posts there's logic to check which format to use, based on the index and the number of posts which have a featured image.

function genesis_sb_do_loop() {
	$count = 0;
	$images = genesis_sb_featured_images( 1 );
	
	if ( have_posts() ) {
		while ( have_posts() ) {
			the_post();
			//do_action( 'genesis_before_entry' );
			if ( $count == 0 ) {
				genesis_sb_hero();
			} elseif ( $count < $images  ) {
				genesis_sb_images();
			} elseif ( $count == $images ) {
				printf( '<div %s>', genesis_attr( "links" ) );
				genesis_sb_after_images();
            } else {
				genesis_sb_after_images();
			}
			$count++;
		}
		echo '</div>';
		do_action( 'genesis_after_endwhile' );
	} else {
		do_action( 'genesis_loop_else' );
	}
}
  • genesis_sb_featured_images() will return 0, 4, 8, 12 or 16
  • it uses genesis_sb_full_rows() to determine this
  • genesis_sb_hero(), genesis_sb_images() and genesis_sb_after_images are the functions being replaced by the three query blocks.

Proposed solution

  • I'll implement the the_posts filter first.
  • I have to find a way of detecting which query block is being processed to determine which of the (up to 60) posts returned in the main query should be processed per block.
  • I'm going to try to override the gutenberg_render_block_core_query_loop() to either fiddle with the main query's posts or handle the loop myself.
  • The override logic will be similar to the solution for Fizzie; I've already implemented logic to override tag-cloud and template-part.

WSOD in Site Editor adding second query block with offset 1 and number per page 60

When I was writing the readme file yesterday I wrote some notes explaining why SB would be harder to develop than Fizzie.

In some respects, even though it should consist of fewer templates and templates parts, SB will be harder to achieve since there is some PHP logic for the home page which I imagine will be more than tricky to implement. I believe I will need to find a method to override server side logic for the query loop blocks. Now I think about it, I reckon I can implement a solution. I supposed I'd better design it first. So I'm going to stop writing this and continue with the "programmming".

Well today I started trying to use the Site Editor to create 3 different query blocks
that I would then fiddle with during server side rendering to
achieve the same logic as implemented in the Genesis-SB theme.

I didn't get very far. I duplicated the first query block then tried to change the Offset to 1 and posts per page value to 60.
The main editor area went white. There were very many errors in the Console. I'll need to start with a clean slate.

Styling blips with v0.2.1

SB v0.2.1 is functionally working fine. There are a couple of styling issues on my iPhone 13 mini and iPad.

  • metadates wrapping
  • no margins
  • drop down menu styling for Sulphurous Brewmasters and Some Background
  • font for tables could be smaller and/or horizontal scrolling supported
  • Site Building menu minimises to hamburger

Update for WordPress 5.8

I updated my local development environment from WordPress 5.7.1 to 5.8 and noticed that the footer widget area was restyled.

Was in 5.7.1
image

Now in 5.8
image

sb doesn't yet use theme.json, it still uses experimental-theme.json. This could be part of the problem. No harm in implementing it anyway.

Implement the menu without using the menu-in-menu plugin?

In the live site the menu-in-menu plugin is used to complete the drop down menus.
There are 4 sub menus: SB, Selected Bits, Section B and Specially Built.

What's the easiest way of incorporating these menus into the main menu?

  • Can it be done with drag and drop?
  • If not, then I'll just have to add the menu items individually.

Requirement

  • Main menu to match the existing live site
  • Easiest way to implement
  • Also, the styling still needs improving.

Proposed solution

  • Try implementing with Drag and Drop in the Site Editor or tempate part editor
  • If that fails do each item manually

Do we need a widget cache?

In seriouslybonkers.com I used to use oik-widget cache to cache the contents of the sidebar widgets.
But there was a probem with caching of the Sequentially Biased widget since it supports pagination;
see bobbingwide/oik-widget-cache#3

oik-widget-cache has been deactivated for a while, but I can't remember why I did it.

Anyway, now that the widgets are implemented as blocks I'm wondering if there's a server performance benefit to caching a selection of the widgets? ie. Can some of the template parts be cached?
If so, how do we go about doing it?

Possible solution

  • Since we're already implementing override logic on template-parts we could implement a className attribute of "cache" on the template part. When this is detected then we'll look to see if there's a cached version.
  • The logic should also take into account the fact that the template-part is newer than the cached version.
  • If so, then it should use the new template part and re-cache the output.

Use the new logic for alignwide and alignfull

In WordPress/gutenberg#29335 a solution has been developed that make alignments more declarative.
ie A new solution makes it a lot easier to use alignwide and alignfull. I believe this means you no longer need a ton of confusing CSS.

Since SB is a brand new theme I feel I should implement the solution in this theme first.
Later, when comfortable with the solution, and when a run time version of Gutenberg is delivered, I should apply it to Fizzie as well. See http://github.com/bobbingwide/fizzies/issues/44

Requirements

As for Fizzie. Properly support alignwide and alignfull, but with widths as below

Style Width Currently used for
normal 800px the content area
alignwide 1200px header
alignfull 100% = 1519 pixels on my laptop, 1903 on my second screen footer

Solution

  • Switch to using a newly built version of gutenberg-source
  • remove assets/alignments-front.css - I'd already done this
  • Change experimental-theme.json replacing "custom" with "layout"
  • Implement `{"layout": {"inherit": true }} attribute on relevant blocks in templates/ template parts
  • Try using different blocks with different widths.

Which is basically the same as for WordPress/theme-experiments#233

Caveat
I don't know what to expect with the sidebar.

Add AI prompt and AI response styles. Adjust featured image size on singular.html

Two changes in one here, both for the Stupidly Brilliant category

  1. As for wp-secrets, I want to be able to style AI prompts and AI responses to show the prompts fed into the AI tools.
  2. Also, since the default image is 1024x1024, I want to reformat the output off singular.html to display a larger featured image.
  3. This either means putting the content below and not side by side, or moving the sidebar below.

the_posts filter affecting Dashboard All Bigrams listing

While investigating the creation of Sampled Bigrams I noticed that the most recent bigram didn't appear to be listed in the Dashboard > All bigrams display.

This was true for both SB and the genesis-SB theme.
I had considered mentioning the problem on the UK Slack channel. But a couple of hours later, while looking at reducing the number of times genesis_sb_the_posts() gets called or actually does stuff, I realised that it was this function that was affecting the display of posts in the Dashboard.

Explanation

Since the most recent post was a Sampled Bigram it didn't have a featured image.
So, even though it was being sorted to the top by the query that was run, it got demoted to behind the posts that did have featured images.

Problem resolution

Adding an early check on is_admin() resolves the issue for the Dashboard post listing.

It's not so easy to reduce the amount of work that the filter function has to do for other queries.

  • Checking for is_main_query() is useless; every query is considered the main query.
  • One tiny improvement is to only call get_post_thumbnail_id when the post is a bigram.
  • Investigating what the actual query is doing is prone to more complexity.

Complete the Singular template

Issue #1 was the first issue for the SB theme, focussing on creating the home page ( index.html )
The Singular template also needs creating:

Requirements

  • Same header, menu, sidebar and footer as the home page
  • Main body to contain:
  • Post title
  • Featured image
  • Post content
  • Seen before
  • Tags for category, S-word and B-word
  • postmeta data
  • post author
  • And, if Jetpack is enabled, the share buttons for Pinterest, Twitter and Facebook - somewhere after the post content.

Proposed solution

  • as above

Add support for additional fields: Suggested/supplied by and Synthesised by - which are probably taxonomies

The new taxonomies could either be created using oik-types or added by the bigram plugin.

Supplied by: is the name of the individual or AI that came up with the SB
Synthesised by: is the name of the AI image generator tool

When the fields have been added the additional text in the post content can be removed.
Note: Synthesised by should be associated with the attachment rather than the bigram post.

Template part has been deleted or is unavailable:

After a rather unsatisfactory export of the templates and template parts I manually created the html files but had a problem when I added the footer to index.html

<!-- wp:template-part {"slug":"footer","theme":"sb","tagName":"footer","layout":{"inherit":true}},"align":"full" } /-->

This results in the message.

Template part has been deleted or is unavailable:

There is nothing after the colon. I would have expected to see the slug or the post ID.
This is explained by the fact that the $attributes['slug'] is not set;
that there's a Warning message to that effect.

Warning: Undefined array key "slug" in C:\apache\htdocs\wordpress\wp-content\plugins\gutenberg-wordpress-source\build\block-library\blocks\template-part.php on line 7

Update for post-terms - Gutenberg something

The three hierarchical taxonomies that are displayed as tags need to be displayed using the post-terms block.
The block's settings doesn't allow the user to decide the taxonomy name; it has to be selected using the term attribute.

<!-- wp:post-terms {"term":"category"} /-->
<!-- wp:post-terms {"term":"s-word"} /-->
<!-- wp:post-terms {"term":"b-word"} /-->

The original CSS that styles the links as inline tags needs to be changed from .wp-block-post-hierarchical-terms to .wp-block-post-terms.

Front end Fatal error rendering tag cloud for unregistered taxonomy

While attempting to check that oik.css wasn't inadvertently affecting the style changes noticed when using Gutenberg-source ( latest trunk) I deactivated oik. This prevented the custom taxonomies from being registered which produced a Fatal error trying to display the tag cloud.

Warning: Attempt to read property "labels" on bool in C:\apache\htdocs\bigram\wp-includes\taxonomy.php on line 582

Fatal error: Uncaught Error: Attempt to assign property "labels" on bool in C:\apache\htdocs\bigram\wp-includes\taxonomy.php:582
Stack trace:

#0 C:\apache\htdocs\wordpress\wp-content\plugins\gutenberg-wordpress-source\build\block-library\blocks\tag-cloud.php(24): get_taxonomy_labels(false) 
#1 C:\apache\htdocs\wordpress\wp-content\plugins\gutenberg-wordpress-source\lib\compat.php(136): gutenberg_render_block_core_tag_cloud(Array, '', Object(WP_Block)) 
#2 C:\apache\htdocs\bigram\wp-includes\class-wp-block.php(221): {closure}(Array, '', Object(WP_Block)) 
#3 C:\apache\htdocs\bigram\wp-includes\class-wp-block.php(211): WP_Block->render() 
#4 C:\apache\htdocs\bigram\wp-includes\class-wp-block.php(211): WP_Block->render() 
#5 C:\apache\htdocs\bigram\wp-includes\class-wp-block.php(211): WP_Block->render() 
#6 C:\apache\htdocs\bigram\wp-includes\blocks.php(799): WP_Block->render() 
#7 C:\apache\htdocs\bigram\wp-includes\blocks.php(837): render_block(Array) 
#8 C:\apache\htdocs\wordpress\wp-content\plugins\gutenberg-wordpress-source\build\block-library\blocks\template-part.php(100): do_blocks('<!-- wp:group {...') 
#9 C:\apache\htdocs\wordpress\wp-content\plugins\gutenberg-wordpress-source\lib\compat.php(136): gutenberg_render_block_core_template_part(Array, '', Object(WP_Block)) 
#10 C:\apache\htdocs\bigram\wp-includes\class-wp-block.php(221): {closure}(Array, '', Object(WP_Block)) 
#11 C:\apache\htdocs\bigram\wp-includes\blocks.php(799): WP_Block->render() 
#12 C:\apache\htdocs\bigram\wp-includes\blocks.php(837): render_block(Array) 
#13 C:\apache\htdocs\wordpress\wp-content\plugins\gutenberg-wordpress-source\lib\full-site-editing\template-loader.php(182): do_blocks('<!-- wp:templat...') 
#14 C:\apache\htdocs\wordpress\wp-content\plugins\gutenberg-wordpress-source\lib\template-canvas.php(12): gutenberg_get_the_template_html() 
#15 C:\apache\htdocs\bigram\wp-includes\template-loader.php(106): include('C:\\apache\\htdoc...') 
#16 C:\apache\htdocs\bigram\wp-blog-header.php(19): require_once('C:\\apache\\htdoc...') 
#17 C:\apache\htdocs\bigram\index.php(17): require('C:\\apache\\htdoc...') 
#18 {main} thrown in C:\apache\htdocs\bigram\wp-includes\taxonomy.php on line 582

Replace Classic blocks with shortcode blocks or equivalent Gutenberg blocks

The Site Editor can't handle Classic blocks. See #6 (comment)

  • The [bw_list] shortcode could be converted to using the Query loop block, but that might stop the Ajax pagination from working.
  • Alternatively use the shortcode block.
  • The [bw_archive] shortcode could be converted to the Archive block. This would require an override to the Server Side Rendering to support the post_type argument - passing bigram. Default is post.
  • Alternatively use the shortcode block.

Add AI revised prompt style. Adjust home page hero layout

The revised prompt is returned from some image generation routines. For SB's which are just entered as two words this can be quite informative. We need to display this using a style similar to is-style-aiprompt with the exception that the font is normal ( sans-serif ) not Serif.

Also, since these images are 1024x1024 we need more space to display them when shown on the home page.
So remove the two 50% columns to leave title, featured image, content.

Additionally, change the code that enqueues the styling for the paragraph such that it will work in the block editor. See tt4ai's code for that.

Create a Full Site Editing version of the genesis-SB theme

Requirements

Approach

  • Implement using Full Site Editing ( FSE )
  • Attempt to create most of the theme using the Site Editor ( beta ).
  • Attempt to style using the Site Editor ( beta ).
  • Incorporate the react-SB page as a block
  • Use modern CSS to style the grids
  • Implement with a side bar
  • Improve performance of both server and front end
  • Dont worry too much about i18n
  • Develop blocks which are missing as blocks in the theme or single block plugins.
  • Allow server side rendering overrides a la Fizzie.

Proposed solution

  • Clone live site and develop locally in s.b/bigram
  • Start with an empty theme - just enough to be able to use FSE
  • Develop a home page with template parts suitable for other pages
  • Develop a 404 page early on ... for the #fse-outreach-experiment
  • Develop a singular template with post-author, metadates, etc

Accidentally updated the Main Menu template part with other blocks

It's far too easy to not realise that you're updating the wrong template part when editing a template in the site editor.
In this example I'd added the columns to contain the main content area and sidebar area into the Main menu template part.

What can be done to prevent this happening in the future?
image

Template Part not found for theme SB generated using new-empty-theme.php

I created the new empty theme for SB using new-empty-theme.php
It lower cased the theme name - from SB to sb.
When attempting to load the header template part it was not found since
the following test failed.

wp_get_theme()->get_stylesheet() === $attributes['theme']

Whose problem is it?

  • Mine for naming my theme SB
  • new-empty-theme.php's for lower casing my theme name
  • Gutenberg's for performing case sensitive tests

Develop nav menu item override a la Fizzie / Thisis

The navigation menu items are hardcoded as s.b/bigram/etc. On the live site these need to be changed to seriouslybonkers.com/

Proposed solution

  • copy the navigation-link.php overrides from Fizzie
  • change fizzie_ to sb_
  • change s.b/wp56 to s.b/bigram

How to style the pagination section?

In the Genesis-SB theme the pagination section's CSS is in style.css.
Here the active page is page 2 and I'm hovering over the Previous Page link.

image

Out of the box styling for the pagination blocks allows me to set the colours for the previous and next pagination blocks but not the numbers. Here I've got two previous blocks, the first has attributes for foreground and background colours.

<!-- wp:query-pagination-previous {"style":{"color":{"background":"#328dbd"}},"textColor":"background"} /-->

image

Rework submit bigram page

In Genesis-SB the Submit Bigram page ( submit-bigram ) uses [bw_login] and [bw_new popst_type="bigram"] to display a front end form to a logged in user to create a new bigram.

This needs fixing and reworking for SB

  1. The form displays Undefined: I and a plan text entry field instead of File: with a "Choose File" button inside and input field of type="file"`.
  2. The form should be wider; no featured image required.

Images incorrectly sized on the home page

image

This happened before when I used the block editor.
The most recent update I did was to the categories.
I reckon there's something wrong with the site editor but haven't analyzed it yet.

<ul class="sb thumbnail wp-block-post-template is-layout-grid wp-container-core-post-template-layout-35 wp-block-post-template-is-layout-grid"><li>
<figure class="wp-block-post-featured-image is-layout-grid wp-container-core-post-template-layout-3 wp-block-post-template-is-layout-grid">
<a href="https://seriouslybonkers.com/bigram/spoon-blade/" target="_self">
<img loading="lazy" width="1024" height="1024" src="https://seriouslybonkers.com/wp-content/uploads/2024/03/Spoon-Blade.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="Spoon Blade" style="object-fit:cover;" decoding="async" srcset="https://seriouslybonkers.com/wp-content/uploads/2024/03/Spoon-Blade.png 1024w, https://seriouslybonkers.com/wp-content/uploads/2024/03/Spoon-Blade-400x400.png 400w, https://seriouslybonkers.com/wp-content/uploads/2024/03/Spoon-Blade-150x150.png 150w, https://seriouslybonkers.com/wp-content/uploads/2024/03/Spoon-Blade-768x768.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"></a>
</figure>
<h3 class="wp-block-post-title has-medium-font-size"><a href="https://seriouslybonkers.com/bigram/spoon-blade/" target="_self">Spoon Blade</a></h3>
</li>
...
</ul>

Develop an archive template - or just use index.html

In the genesis-sb theme there are a number of specialised templates for displaying archives.
These use a common function called genesis_sb_page()
Is this logic necessary in FSE, or can we just get away with index.html?

Genesis-SB Special logic? SB template
archive.php archive.css index.html
category.php achive.css index.html
date.php date.css - empty index.html
search.php YES search.html

Quick analysis indicates that we can get away with using index.html for the archive, category and date archives but need special logic for the search results.

Search results

The Search template displays different results depending on the actual search performed and the results obtained.
This is implemented by logic in a couple of filter functions genesis_sb_do_search_title and genesis_sb_search_banter()
The first displays the heading, the second the report on the search terms used


No results found

Search Results for: serve busts
Searching Beautifully...
Considering terms: serve busts
This doesn't qualify for automatic creation of an SB.

Results found

Search Results for: supplied by
Searching Beautifully...
Checking first post: Steve Biddle

Then the results are displayed as for index.html

Only an S word

Search Results for: supplied
How about a B word too?

Only a B word

Search Results for: by
How about searching for an S word as well?

Bad search

Search Results for: frogs legs
Try to search for an S-word a B-word or both
Sorry but, no posts surfaced before I gave up looking. Sobeit.

Possible solution

It could be possible to add a search-banter.html template part to index.html; inside body-and-sidebar.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.