Howdy, @Ninthony ! I seem to be having the same issue of a blank box remaining after I removed the title from my blog pages. I read your comment about wrapping the liquid code around the HTML, but I’ve got through the code and can’t see what you’re referring to. I’m currently working within article.liquid to remove the title text. The box isn’t massively noticeable, but it would be nice if the margin about the first content image could be the same as the margin to the left and right of the first content image. How would I go about doing this? Here is a blog article example. THANK YOU!!!
I also wanted to hide my titles (contact us/shipping policy/terms of service), but this didn’t work for me-I’m using the debut theme. Is there another way I can try?
I’d also like to remove the “Shipping calculated at checkout.” on my product pages if possible !
If so, you can adjust the title headings in your store admin by going to Online Store > Navigation. You can see the guide Shopify created about this here. Let me know if this is what you mean. If it isn’t can you elaborate and show me what you are referring to please!
Your code looks right, there could be other things going on. Perhaps a different page template is being used. Go ahead and type something next to your page title, anything you want to show up to let you know you’re in the right place. For instance I always just type a string of a’s like “aaaa”. Refresh your page and see if that shows up next to your title. If it does, you’ll know you’re in the right place, if it doesnt, you’re in the wrong place. If it does, then go ahead and echo out what your page handle is to make sure the condition you’re trying to compare is correct by placing this in your code:
{{ page.handle }}
Refresh the page and see what shows up, that’s going to be what you need to put in quotes on your condition.
If you’re going to do it for multiple pages, it might be a better idea to just create an alternate page template that you remove the title from, then apply that template whenever you create the pages. Otherwise you’re going to end up with a long stretch of “or” conditions, because you can keep appending to the unless statement:
{% unless page.handle == 'your-first-page' or page.handle == 'your-second-page' or page.handle == 'your-third-page' %}
{{ page.title }}
{% endunless %}
You could make an array of collection handles and loop through them, then if the page handle at any point is equal to any of the page handles in the array, set a variable to true and hide the page based on that condition:
// set variable to false by default
{% assign hide_page_title = false %}
//make a string variable of the handles, separated by a comma and space
{% assign handle_array = "sizing, contact, mindset" %}
//split that string by the comma and the space to create the array
{% assign handle_array = handle_array | split: ', ' %}
//loop through each item of the array and compare it to the page handle and set the variable to true
{% for handle in handle_array %}
{% if handle == page.handle %}
{% assign hide_page_title = true %}
{% endif %}
{% endfor %}
//then wherever your page title comes into play, use a condition around it
{% unless hide_page_title %}
{{ page.title }}
{% endunless %}
I am having this exact same problem. CSS worked great in removing the titles but then leaves a large white gap. Am I able to get any advice for this at all?
To be perfectly honest, my coding knowledge is very limited and I would not be 100% on this. Hopefully, Ninthony sees this as they would definitely be more equipped than me to helping you. Would you be able to reply and share your URL, what theme you’re using, and if possible a screenshot of the exact area you’re referring to? It would be a great help in troubleshooting this further for everyone.
Screen shot below of my contact page. See the large gap between the main menu and my first line of text. This is the same on my about page and collection page.