• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Remove the title on Storefront theme pages or posts

Discover in this tutorial how to hide the title on Storefront theme pages or posts in using code.

Storefront is one of the most suitable themes to use in conjunction with WooCommerce as it has been created by the same company and the integration of the theme with the plugin is very good.

If you are using it and you want the home page (or other) not to display the title, because, for example, you prefer to add it with the block editor, here’s how to do it.

Snippet to remove the title in the Storefront theme

Add the following snippet to the end of the functions.php file:

To see this and another 919 code snippets of this website, login or subscribe here.

In this snippet you remove the function storefront_page_header from the main page using the conditional tag is_front_page. You can achieve the same for individual pages using the conditional tag is_page.

If on the other hand you prefer not to have the title displayed when using a specific page template, this would be the snippet you need:

To see this and another 919 code snippets of this website, login or subscribe here.

In this case you use the same function to remove the title but the conditional tag is is_template_page.

In this example you use an array where you add two templates where you do not want the title to be displayed:

  • template-fullwidth-no-title.php
  • template-fullwidth-narrow-no-title.php

Just change it to the name of your page template and indicate the path where it is located. In the example it is page-templates/, but you can adjust it if you have modified the theme structure.

Conclusion

As you can see, with a few lines of code you can hide the title of pages or posts in the Storefront theme.

Any questions? I read you in the comments.

And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉

PHP Title

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?