- This topic has 11 replies, 2 voices, and was last updated 4 years, 3 months ago by
Ying.
-
AuthorPosts
-
July 1, 2019 at 8:15 am #946187
Stuart
Is there not a way to center headings in pages and posts? I haven’t seen an option for that and all the text automatically goes leftward.
July 1, 2019 at 8:20 am #946193David
StaffCustomer SupportHi there,
we are looking at possibly adding them as Customizer options, if there is enough interest. But it takes 3 lines of CSS to currently do it:
h1.entry-title { text-align: center; }July 1, 2019 at 9:09 am #946230Stuart
Thank you. How and where would I enter this code? And can it be used to center headings in some pages but not others?
July 1, 2019 at 9:12 am #946233David
StaffCustomer SupportSo you can add it to the Customizer > Additional CSS – and it will apply to all pages and posts.
To set it to specific pages / posts you would need to specify the unique page-id / post-id for each one in the CSS. So simpler way is to:1. Create a new Hook Element:
https://docs.generatepress.com/article/hooks-element-overview/2. Add this as your content:
<style> h1.entry-title { text-align: center; } </style>3. Select the
WP_headHook from the Hook list4. On Display Rules set the posts / pages you wish it to work on. You can use taxonomies ( categories and tags ) if you like. Or set it to the Entire Site and then exclude the ones you don’t want it on.
July 1, 2019 at 9:27 am #946253Stuart
What is the definition of a “hook”?
July 1, 2019 at 9:46 am #946274David
StaffCustomer SupportSimple put it is a ‘placeholder’ left in the templates code – which allows a user to ‘hook’ in their own content.
The WP_Head hook places the content / code inside the
<head></head>of your website.July 1, 2019 at 2:49 pm #946502Stuart
I see. Thank you.
July 1, 2019 at 2:51 pm #946503David
StaffCustomer SupportYou’re welcome.
The Theme has lots of Hooks, you can see the most commonly used ones for the various templates in this visual guide:January 3, 2022 at 12:07 pm #2067945Harry
Hello GP Team, has centering headings been added to the new typography module, or does it still require custom CSS? I looked but didn’t see it.
HarryJanuary 3, 2022 at 12:48 pm #2067997Ying
StaffCustomer SupportHi Harry,
text-alignis not included in the typography settings.So CSS is still required.
January 3, 2022 at 1:06 pm #2068022Harry
OK, thanks. Easy to do.
HarryJanuary 3, 2022 at 1:30 pm #2068047Ying
StaffCustomer SupportNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.