Difference between revisions of "How to change the title of the home page"

From Spiffy Stores Knowledge Base

Line 1: Line 1:
Please note: If your store uses the Minimal or Seattle theme, you can chnage the title of your home page in the "Design &amp; Assets -&gt; Theme Editor" section of your store Toolbox.<br><br>The home page has a default title of 'Welcome'.  
+
Please note: If your store uses the Minimal or Seattle theme, you can change the title of your home page in the "Design &amp; Assets -&gt; Theme Editor" section of your store Toolbox.<br><br>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.  
 
If you want to change this, you will need to make a simple change to your Theme.liquid file.  

Revision as of 11:33, 17 September 2011

Please note: If your store uses the Minimal or Seattle theme, you can change the title of your home page in the "Design & Assets -> Theme Editor" section of your store Toolbox.

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.

An alternative method for changing the Home page title and description meta tag is available using the Theme settings file. For further information plase read Setting the default Home page title and description.

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>
    ...