Scroll to top

17/01/2021

The home on the web of Colin Walker.
Find out more on /about, say /EHLO, or tune in to the daily RSS feed.

2021/01/17#p1

I realised pretty quickly that a straight LIKE query wasn't going to work for search as it caught things like parts of URLs where the search term wasn't in the actual text.

Switching to a REGEXP query has resolved this although it took me some time last night to work out the correct regex pattern to exclude what I need. Looking at this introduced me to regex character classes like [:punct:] which came in handy.

This morning I have added highlighting of the search term within results using a preg_replace to only include the correct parts (i.e. not breaking any HTML) in styled <span> tags. If no results are found there is a link to search the archive AKA the WordPress posts.

It's coming together nicely.

No comments yet
Leave a reply



You can also:

Click here to reply using email Reply by email Send a webmention Send a Webmention



2021/01/17#p2

Pro tip: don't put your fingers in the boiling water when poaching eggs.

No comments yet
Leave a reply



You can also:

Click here to reply using email Reply by email Send a webmention Send a Webmention



2021/01/17#p3

Liked: Really excited to have the first inst... – James Van Dyne...

Another #CustomCMS

No comments yet
Leave a reply



You can also:

Click here to reply using email Reply by email Send a webmention Send a Webmention



2021/01/17#p4

After adding a number of pages (grandchildren) to the Garden recently performance has absolutely tanked. The nested queries are obviously struggling.

I'm looking at replacing the queries with wp_list_pages() but need to sort out a custom walker for changing the output to include the additional functionality I had built.

It feels a bit weird working on WordPress stuff again.

No comments yet
Related post - 21/01/2021
The rebuild of the Garden home page didn't need the custom walker after all. By adding a filter to wp_list_pages() (which I remove if not logged in) I…
Leave a reply



You can also:

Click here to reply using email Reply by email Send a webmention Send a Webmention



2021/01/17#p5

Jean Tubridy celebrated ten years of blogging yesterday by listing "10 things I would say to beginner blogger me."

Consider:

"You will meet many fascinating people through this and many who you will count as true friends."

and:

"Treasure those who take the time to engage with you. This is valuable time they could have been using some other way."

But don't forget:

"Don't try to be someone you aren't. It isn't sustainable long term in blogging."

Via David Kanigan.

No comments yet
Leave a reply



You can also:

Click here to reply using email Reply by email Send a webmention Send a Webmention



Close