Developing This Site V1

On the technical side of how I setup this site: I used WordPress, which is a blogging and website building platform that I highly recommend. If you use it, you will see how it greatly simplifies producing and publishing the type of content here.

While WordPress was immensely helpful in creating the type of site that I wanted, there were some aspects that took me a while to develop and figure out, which were not as obvious when I first used WordPress. I discuss these now.

Search and Header Tab Design

WordPress automatically provides a snazzy search bar feature (depending on your theme; I’m using the Twenty Twenty theme):

  1. Go to Appearance, then Customize, then Theme Options.
  2. Check the box for “Show search in header.”

This bar shows up on the header, on the same row as the menu. I think you can also include a search bar as a content block in a post or page.

Now, this search feature will go through everything that is hosted on your WordPress website, so it won’t go through external links — which is expected. This presented a challenge for me, however, because earlier I had defined the menu tabs to be something like:

  1. Career
  2. Papers
  3. Notes
  4. etc.

I also didn’t want to for example just copy and repeat a lot of the content already on my LinkedIn, so for the “Career” tab I wanted to just link to that. But then this created the false impression that the search feature would go through content on my LinkedIn page when in fact it wouldn’t!

My solution was to create a “Links” tab for all the content hosted externally to WordPress. I love this solution so much since it seems simple and obvious when you come up with it, but while I was figuring it out it didn’t feel obvious at all. Now, with the “Links” tab, it feels clear that these are external links that the search wouldn’t go into. (It still makes sense intuitively that the search goes through the text of the links, just not into the pages that are linked to; I enable this by having a “Links” page in addition to a sub-menu for the “Links” tab.)

This also allows my “About Search” page to be more generic and less confusing about what is included and what is not; I will discuss how I created this page now.

The “About Search” Page

The goal was to clarify certain aspects of the search feature if people weren’t able to find results for their query. Thus, the idea was that at the end of every search results page there would be a message like, “Can’t find what you’re looking for? Click this link to read more about the search feature.” Now, I didn’t want to clutter every post or page with this message; rather, I wanted it to only be visible on search results pages. How can we accomplish this?

Luckily, at least for my theme, WordPress supports options and filters that enable this. Specifically, it supports pieces of content that it calls widgets, where you can customize which pages the widget shows up on and where on the page. The process for me was:

  1. Go to Appearance, then Customize, then Widgets.
  2. My theme allows displaying widgets in two sections: Footer #1 and Footer #2. I added my widget to Footer #1.
  3. For my widget, I knew I wanted a text message and a link, so I selected “Custom HTML.” I used the following code:
    Can't find what you're looking for? <b><a href="PAGE_LINK">About Search</a></b>
  4. For that widget, go to Visibility. This section allows you to specify filters to customize which pages the widget shows up on. I specified for it to only show up on search results pages.

I then clarified in the “About Search” page certain aspects of the search feature, like for example that it may not necessarily search properly through equations. If you use the search bar and scroll to the bottom of the results you can see this widget in action yourself!

EDIT (11/2023): I actually removed this “About Search” page and the associated “Can’t find what you’re looking for?” tag on search results pages, in favor of a subscribe form in the footer of every page. For this, I did a little special-casing for the “Welcome!” front page, which I accomplished by putting the subscribe form in a widget that I could then set the visibility of — go to the “Block” tab for the settings of the widget, and then look at the advanced options. (EDIT May 2025: I removed this special casing.) I’m nevertheless keeping this page up so that it can serve as a chronicle of how my website design has evolved, and also so that other people who may want to create an “About Search” like I had earlier can benefit from this. (EDIT August 2025: I added the “About Search” page back, once I replaced the subscribe form at the bottom with a floating subscribe button, which was an option in Settings –> Newsletter.)

Modified September 28, 2022. (Small changes made later are timestamped above.)

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.