bobbingwide / sb

SB: Second Byte - Seriously Bonkers' experimental Full Site Editing theme
GNU General Public License v3.0
0 stars 0 forks source link

Create a 404 page for when the link is Not found #22

Open bobbingwide opened 2 years ago

bobbingwide commented 2 years ago

The current page in genesis-sb is:

image

bobbingwide commented 2 years ago

On the 404 page, when a link that has been auto generated using sample_bigrams::the_content is not found, for whatever reason, then it makes sense to implement similar logic to that implemented for search banter.

ie If the URL is for an SB bigram ( bigram\sword-bword eg https://s.b/bigram/bigram/six-bells ) then generate a post for it. In this case the title would be Six Bells; first letters capitalized.

Is it possible to determine the referrer in order to populate the content as "Referred from Sword Bword"?

bobbingwide commented 2 years ago

Is it possible to determine the referrer in order to populate the content as "Referred from Sword Bword"?

HTTP_REFERER may contain the URL of the referring post eg "https://s.b/bigram/bigram/shark-bloke/" but more often than not it'll be the home URL or an archive URL eg "https://s.b/bigram/s-word/shark/"

If it's the home URL we could infer the original post by running the main query run for the home page. Ditto for an archive. Or we could just run a search query and use the first post that's found.