How do I edit {{ content_for_header }}? Classic theme

Highlighted
Shopify Partner
6 0 4

How can i edit or change injected content from {{ content_for_header }} . The problem is my previous FB Pixel code is injected by {{ content_for_header }} in the site. I want to remove old one.

1 Like
Highlighted
Excursionist
14 0 4

I also get `$ is not defined`. It is a very annoying error, is there any way to fix it?

0 Likes
Highlighted
Shopify Partner
12 0 7

"$ is not defined" is usually a sign that one of your scripts requires jQuery but jQuery hasn't been loaded yet (or at all).

If you've recently edited scripts, make sure that jQuery is the first one loaded in.

0 Likes
Highlighted
New Member
2 0 0

Hey, it seems that Shopify succeeded to prevent that. Do you have any workaround to load those content_for_header's scripts asynchronously?

0 Likes
Highlighted
New Member
2 0 0

Did you ever get an answer to your fb pixel being injected into the content_for_header? I am in the same situation. I am trying to remove the fb pixel but it still shows another fb pixel is in the header of {content_for_header}?

0 Likes
Highlighted
New Member
1 0 0

Late to the show here, but you can remove strings from the {{ content_for_header }} quite easily, in liquid.

To switch
{{ content_for_header | replace: '1234567890', '0987654321' }}

To remove
{{ content_for_header | remove: '1234567890' }}

 

 

0 Likes