How can I modify the footer only on product pages?

Solved

How can I modify the footer only on product pages?

LeticiaIb
Excursionist
29 0 6

Hello, I would like to edit only the product pages' footer, so it doesn't display my Footer's Menu and my social media icons. When I change it on the product page template, it changes for every page.

I hope you can help me.

Thank you!

Accepted Solution (1)
Abdosamer
Shopify Partner
959 174 203

This is an accepted solution.

@GO to theme.liquid and add the following code before the </body> tage :

{% if template == "product" %}
  <style>
 .footer-block:only-child:last-child {
    
    display: none !important;
}
.footer-block--newsletter {
    
    display: none !important;
}
</style>
{% endif %}
Buy me a Coffee
Email : abdelrahamansamer71@gmail.com
Chat on WhatsApp
My work

View solution in original post

Replies 11 (11)

Abdosamer
Shopify Partner
959 174 203

Hi @LeticiaIb , can you share your store url?

 

Buy me a Coffee
Email : abdelrahamansamer71@gmail.com
Chat on WhatsApp
My work
LeticiaIb
Excursionist
29 0 6
Abdosamer
Shopify Partner
959 174 203

This is an accepted solution.

@GO to theme.liquid and add the following code before the </body> tage :

{% if template == "product" %}
  <style>
 .footer-block:only-child:last-child {
    
    display: none !important;
}
.footer-block--newsletter {
    
    display: none !important;
}
</style>
{% endif %}
Buy me a Coffee
Email : abdelrahamansamer71@gmail.com
Chat on WhatsApp
My work
LeticiaIb
Excursionist
29 0 6

Thank you so much! Have a good evening

jrfellers
Tourist
9 0 2

Hi, I have a similar question but slightly different desired outcome.  I'm trying to remove ONLY the payment ICONS from the homepage.  I assume that I need a different template value.  I've tried "Home page", "homepage", and "Homepage" but nothing works.  Any thoughts on what needs to be changed in the above code? 

Thank you!

Abdosamer
Shopify Partner
959 174 203

Hi @jrfellers , can you share your store url?

Buy me a Coffee
Email : abdelrahamansamer71@gmail.com
Chat on WhatsApp
My work
jrfellers
Tourist
9 0 2

Sure…it’s jiggerjunction.com

Abdosamer
Shopify Partner
959 174 203

@jrfellers , Can you share the password?

Buy me a Coffee
Email : abdelrahamansamer71@gmail.com
Chat on WhatsApp
My work
jrfellers
Tourist
9 0 2

Sorry about that!  Shared privately.  Also, since I didn't mention it earlier, the theme is Dawn. 

Abdosamer
Shopify Partner
959 174 203

@jrfellers , Go to theme.liquid file and add the following code to the end of it before the </body> tag:

{% if template == "index" %}
  <style>
 .footer__localization:empty+.footer__column--info {
    display: none;
}
</style>
{% endif %}

This will hide the payment icons on the homepage 

Buy me a Coffee
Email : abdelrahamansamer71@gmail.com
Chat on WhatsApp
My work
jrfellers
Tourist
9 0 2

@Abdosamer That did it!  Comparing that with what you shared earlier with @LeticiaIb  shows me that I wasn't even close to being able to use that code "as is".  Thank you so much for your help!