the Blog
RSS FeedAfter many years, while working on a new project, I noticed that searches on WordPress sites with an empty search query return every searchable, published item from the posts table instead of no results.
This doesn’t seem correct—an empty search should return no results.
Doing a web search for the problem, most answers suggest modifying the search query with $query->set('post__in', array(0));
. This doesn’t work. The results still contain everything.
The post__in
array needs one small change to work; switch the 0
to a -1
.
Add the final function to functions.php
:
function mysite_empty_search_term_results($query)
{
$search_query = trim(get_search_query());
if (!is_admin() && $query->is_main_query() && $query->is_search() && empty($search_query)) {
$query->set('post__in', array(-1));
}
}
add_action('pre_get_posts', 'mysite_empty_search_term_results');
Code language: PHP (php)
More is more when it comes to this illustration. It started as doodling randomly with symmetry enabled in Procreate, and I just kept going. I let my brain dance across the canvas without worrying about what the drawing would be, if I focused too much in one area, skipped around the canvas too much, or even if I’d finish it.
The random and carefree nature of the exercise worked well for my ADHD brain, and hyperfocus set in. Eventually, my creativity and eye for design started making sense of the chaos—finding patterns, making connections, and filling space.
Playing with texture and radial symmetry in Procreate.
I started this sketch of a stylized petri dish a few months ago in my sketchbook, and yesterday, I was inspired to add some color. My first thoughts were to go with a muted color scheme in yellows, browns, and greens, but as I started adding ink to the page, the idea evolved into something different and much more colorful.
Hues shift around the image to show subtle mutations occurring as the microorganisms divide and the colonies grow.
Earlier this week, I was inspired by Microbe Art Walk (and #MicrobeArtWalk on Twitter) to draw something small. It started with shapes and a color palette derived from diatoms and grew from there.
Eric Meyer launched a redesign of his site a few days ago. The design is inspired by Hamonshu, Vols. 1-3, a Japanese book of wave and ripple designs, published in 1903. In his post, he talks about his inspirations and design process. The final result is beautiful with lots of small details and touches.
As a follow-up, he also posted his method to add pseudo-random illustrations with CSS as separators between entries on the site.