Archived topic
How to add padding on the left and right of the title in mobile
5 replies · Started by Shami on September 3, 2020
I've edited the theme files to put the blog post title outside the page container.
It looks fine on desktop. But sometimes, in mobile, the padding seems to be missing on the left and right side. The title touches the container on the left and right. This happens only in mobile.
How do I add padding?
Please note that I've tweaked the files to display title above the page container. Normally, padding can easily be added in the customization settings. But this case is different.
Hi there,
you should never edit the Theme files - any changes you make to them will be lost when the theme is updated.
If you want o place the Title outside of the container then use a Header Element instead:
https://docs.generatepress.com/article/header-element-overview/
You can add the <h1>{{post_title}}</h1> template tag to the header element to dynamically display the current post title. It will also automatically remove the title in the content.
Figured it out. Thanks
Glad to hear that
Also, it looks like loading time has improved. I guess those css and code in functions.php were affecting the loading speed. Is it true? Do those little code snippets affect loading time?
It could be but should be minimal if there is only a little bit of code.
Tough for us to tell.