I don’t know if I’m going about this the best way (hopefully I am), but I inserted the following code I found from a post on this website into my layout/theme.liquid file to make my product titles dynamic:
<title>{% if template == "product" %}{{ product.title }} | {{ shop.name }}{% endif %}</title>
Mission accomplished. It worked just as I’d hoped. However, now my products are the only pages with titles. How can I edit the code so all the pages (not just the products) have appropriate titles for SEO?
2
Answers
All you need is an else condition:
HTH
Use the default liquid object to show the titles, you can check more about this here
page_title
Also, you can check the reference code from
theme.liquid
file of the default dawn theme from Shopify itselfDawn theme