How to change the title of the home page

From Spiffy Stores Knowledge Base

Revision as of 10:06, 27 January 2011 by Admin (talk | contribs)

The home page has a default title of 'Welcome'.

If you want to change this, you will need to make a simple change to your Theme.liquid file.

Edit your Theme.liquid file and you will probably see something like this at the start of the file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    {{ header.author }}
    {{ header.copyright }}
    {{ header.description }}
    {{ header.keywords }}
    <title>{{page_title}} — {{shop.name}}</title>
    ...

To add a custom home page title, you just need to add the following line just above the <title> tag.

{% if template == 'index' %}{% assign page_title = 'This is my custom home page title' %}{% endif %}

Change the title text to whatever you want and then insert the line as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    {{ header.author }}
    {{ header.copyright }}
    {{ header.description }}
    {{ header.keywords }}
    {% if template == 'index' %}{% assign page_title = 'This is my custom home page title' %}{% endif %}
    <title>{{page_title}} — {{shop.name}}</title>
    ...