BACK

where is the body tag in shopify liquid scripts

Add Custom CSS Class in Body Tag Dynamically ✅ Shopify Theme Development Tutorial hey dear welcome t

Foysal Ahmed

Updated on Mar 18,2023

Add Custom CSS Class in Body Tag Dynamically ✅ Shopify Theme Development Tutorial

The above is a brief introduction to where is the body tag in shopify liquid scripts

Let's move on to the first section of where is the body tag in shopify liquid scripts

Let TThunt's experts help you find the best TikTok product on your Shopify business!

Find TikTok products (It's Free)
No difficulty
No complicated process
Find winning products
3.5K Ratings

WHY YOU SHOULD CHOOSE TTHUNT

TThunt has the world's largest selection of TikTok products to choose from, and each product has a large number of advertising materials, so you can choose advertising materials for TikTok ads or Facebook ads without any hassle.

where is the body tag in shopify liquid scripts catalogs

Add Custom CSS Class in Body Tag Dynamically ✅ Shopify Theme Development Tutorial

hey dear welcome to you in my youtube,channel in this tutorials i am going to,show you how to add a custom class to a,body tag in dynamically in your shopify,theme,so if you wanted to learn shopify theme,development or,wanted to learn shopify theme,customization and you have already,started learning to improve your skill,then you can continue this video here we,are going to learn creating useful css,hook in liquid so let's get started,many of us use the body class for css,and javascript hook and just like in,wordpress it's pretty easy to add a,number of useful classes to our body,element in shopify for example if you,already familiar with wordpress theme,development then i hope that you know,how we can add,dynamically individual classes for,different pages or template in wordpress,let me show you and real example here is,the file of wordpress and you can see,that there is a code snippet and like,this one we can add same picture in our,shopify so now i'm going to my shopify,online store here is my shopify online,store and i'm going to,my contact page just click on the right,button up my mouse,then select inspect,now looks very carefully,if i select body then we can see that,there is no classes right here,basically we wanted to,individual class dynamically right here,for this page also if you go to the,about page,then there will be,another dynamic class,in the body tag,in the same way if you go to the faq,page or blog page we get always a an,individual class for this template okay,so now i'm going to show you how we can,add this in our theme i'm going to my,shopify admin panel here is my shopify,admin panel click on the online store,then click on the action button select,edit code now,open the layout folder,then team liquid file,okay now you can see that there is a,body tag there is no any extra code,right here for example what we have seen,in the wordpress file,like this one,body,psp code for the dynamic classes as you,know wordpress is filed with psp and if,you compare with our shopify team we can,see that there is nothing that will work,to add individual dynamic classes right,here,based on our template okay so now we are,going to add our code or write our code,to get dynamic classes for the,individual pages,okay,we have done click on the save,and,refresh my browser and check the,body tag reload,and you can see that there is a class,named blog and we are in our blog,template dot blog page and i am going to,visit the faq page,you can see that there is a,class,faq page,in the same way if i go to the catalog,page,then we can see that there is a,collection class,so i hope you understand how we can add,dynamically classes in our shopify theme,and if you are shopify theme development,learner customization learner this,tutorial is helpful for you so thank you,for your time to watch this video if you,think this video is helpful as a,beginner then click on the like button,and subscribe to my channel

Congratulation! You bave finally finished reading where is the body tag in shopify liquid scripts and believe you bave enougb understending where is the body tag in shopify liquid scripts

Come on and read the rest of the article!

Browse More Content