# Liked ten recent thoughts – rebeccatoh.co...
I couldn't help but think of "Fear is the path to the dark side. Fear leads to anger. Anger leads to hate. Hate leads to suffering" when reading number 6 as Rebecca originally wrote "Circumstances trigger thoughts. Thoughts lead to emotions. Emotions influence our actions."
# O. M. G! Massive twist and reveal at the very end of The Mandalorian season 2, episode 1.
Can't wait to see how that plays out.
# I had a really good conversation with my wife yesterday, in it she hit hard with a number of home truths. Sounds bad but it was actually the opposite: it made me see some things for what they truly were and gave me the impetus to get on with something I've been putting off for far too long.
# So that I can keep track of what I'm writing I've added word counts to the garden pages using the PHP function str_word_count()
. While editing a page I have a JavaScript function to return the count on the fly in response to the oninput
event.
The two methods return slightly different values but it gives me a rough idea.
# A few tweaks to the JavaScript have gotten them a bit closer.
# Ah, the morning battle with spam email - nothing quite wakes you up like it. I create multiple spam filters which catch some of it but also tweak the threshold on the server in an attempt to find the sweet spot which catches as much as possible without generating false positives. It's a game of cat and mouse where I feel like the Tom to spam's Jerry. # The more I use the new setup the more I like it. Having a unified posting experience with inline editing and all content filters available across the whole site (both blog and garden) is like a dream. Love means never having to use wp-admin! And it's only by really using something that you can make it better; I keep finding little quality of life tweaks to add such as adding a live word count to the blog (just like the garden) so I can keep track while posting. I have also added a new search filter to
pre_get_posts
so that those searches conducted within the garden only finds results from those pages. Firstly, I added a hidden field to the search form called 'source' and set the value to garden, then filter the query to only return page that use the garden template:function SearchFilter($searchquery) { $source = $_GET['source']; if ($searchquery->is_search && $source == 'garden' ) { $searchquery->set('post_type', 'page'); $searchquery->set('meta_key', '_wp_page_template'); $searchquery->set('meta_value', 'garden_template.php'); } return $searchquery; }
add_action('pre_get_posts', 'SearchFilter'); Works like a charm. # Oh, and how could I forget full sorting of the garden home page by modified date including children and grandchildren rather than just parent pages. It's only a small thing but it's a nice touch. # Check your T's & C's:
# Today should be a watershed: it is the first day out of England's second lockdown and we are back on the tiered system. Still, it makes little difference as far as I am concerned - an excess of caution is still the order of they day. That the UK government has approved the Pfizer Covid vaccine, and the first doses should be available next week, is huge. It will take months for wide-scale distribution so we can't quite see the light at the end of the tunnel but at least we know we are in a tunnel so the light can't be too far away. # Theoretically, I can insert new sections at any point of a day (maybe I want to continue a thought) and the RSS feed itself will not be impacted. What would happen, however, is that a change in order would mean that the individual permalinks would start pointing to the wrong sections. When I add a new section I should, therefore, be able to assign it a section number, write that to the database and construct the permalinks based on that. A query would be able to retrieve the latest section number from the database and then increment this for each new section. Iteration... # I think I've got a lot of the mechanism in place so this update will be the acid test. If the section number is correctly written to the database and follows sequentially from the previous one then we're in business. # A number was written to the database, just not the right number. I think it's because I had the instruction in the wrong place. But we're half way there.