Posts and site content

Add search to your site

The Search block adds a search icon or a search bar. When a reader clicks it, Ghost's own search window opens. It finds posts, tags and authors as the reader types. Ghost provides the search itself, so there is nothing to set up in Ghost Admin.

The header of the default layout already has a search icon, which is a Search block too. To change it, edit the header as Change the header and footer on every page shows. Add another Search block wherever readers should find one, such as in a hero on the Homepage or on the Error template.

  1. Open your project in Fantasma.
  2. In the left sidebar, under Templates, click the template, such as Homepage.
  3. In the Sections list, point at the row of the section where the bar goes, and click the + at its right end. The block picker opens.
  4. Under Controls, click Search. It appears at the end of the section as a gray bar, and its settings open in the right sidebar. To move it, drag its row in the Sections list.
  5. In Placeholder Text, change the words in the bar if you like, such as Search the journal. The default is "Search posts, tags and authors".

The search window opens only on your Ghost site, after you publish the theme. In Fantasma, clicking the block selects it and opens its settings.

Change how it looks

In Variant, at the top of the block's settings, pick one of three looks:

Variant Looks like
Filled A gray, rounded bar. The default.
Plain The magnifying glass and the text alone, with no bar around them.
Outline A rounded bar with a thin border.

For an icon with no words, select Plain and clear Placeholder Text. Screen readers then read the button as "Search". The header's search icon is set up this way.

Variant picks one of the looks that every Search block shares. To change a look itself, and with it every search bar that uses it, open Blocks in the narrow bar at the far left of the editor and edit Search there. Change how every button looks shows how looks work.

Search lists the block's other settings.

Was this article helpful?