- This topic has 9 replies, 2 voices, and was last updated 5 years, 9 months ago by
Leo.
-
AuthorPosts
-
June 16, 2020 at 4:13 pm #1330596
Mark
I would like to put some text at the beginning of the “About Us” page that would be styled (larger font size, different color, etc) than the text in the body of the page.
To that end, I added placeholder content “Before Content” using the Legacy Hook “Before Content.” I would like to style the text in that Hook.
Can you tell me how I would do that? Or if this is the best way to add styled text to a page. I’m trying to do this in a way that one of our content providers can simply add text and have it styled automatically, since she is not familiar with styling.
Thanks in advance,
Mark
June 16, 2020 at 9:47 pm #1330761Leo
StaffCustomer SupportHi there,
You would do something like this:
<div class="custom-before-content"> Your before content hook content </div>Then style it with CSS:
.custom-before-content { font-size: 20px; color: #000; }Adding CSS: https://docs.generatepress.com/article/adding-css/
Also any reasons why you are not using the new hooks element module?
June 16, 2020 at 10:10 pm #1330791Mark
Hi Leo,
Thanks for your reply. I tried using the legacy hook, which I guess is different than the New Element hood. However I couldn’t figure out how to target that spot so I could add CSS.
June 16, 2020 at 10:15 pm #1330794Leo
StaffCustomer SupportMy method above would work in both the legacy hook and hooks element.
Have you tried it?
June 17, 2020 at 11:42 am #1331728Mark
Leo,
I haven’t yet. I just realized I would put the CSS in the “Additional CSS” spot in the customizer – that should work I think. I was thinking the hook page would have a box for CSS since I’m using “Simple CSS.”
Mark
June 17, 2020 at 12:08 pm #1331759Leo
StaffCustomer SupportNope there is no SimpleCSS metabox on the hook page.
Additional CSS would work better as it would apply the style globally.
June 17, 2020 at 12:35 pm #1331790Mark
Leo,
Thanks for getting back to me. Since the person adding the content is not technical, I think it is easier for her if I just add the content to the page itself using your original method. That was she can use a visual editor to add/edit content.
Is there some disadvantage to this method, as opposed to using the Before Content hook?
Thanks
MarkJune 17, 2020 at 2:26 pm #1331866Leo
StaffCustomer SupportIf you use the hook then you only need to add the content once.
If you add it as a page content then you’d need to add it everytime you want the content to show.
June 17, 2020 at 5:17 pm #1331970Mark
Ok, thanks
June 17, 2020 at 6:57 pm #1332022Leo
StaffCustomer SupportNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.