How to Customize Fonts and Typography in the OnePress Theme
Content
Customizing the look and feel of your website's text is a common need for many OnePress theme users. Whether you want to adjust font sizes for better readability, change colors for improved contrast, or switch to a different font family, this guide covers the most effective methods based on community solutions.
Common Font Customization Requests
Users frequently seek to modify:
- Global font size and color for body text
- Heading sizes (H1, H2, H3, etc.)
- Font colors in specific sections (e.g., Features, About, CTA)
- The default font family (e.g., removing Google Fonts for GDPR)
- Link and hyperlink colors
- Menu font styles
Why These Changes Are Often Needed
The OnePress theme has predefined styles for typography. In its free version, it does not include built-in controls for granular typography settings. This means users must employ custom CSS to achieve their desired look. Common reasons for these changes include improving accessibility (WCAG compliance), adhering to brand guidelines, or enhancing readability on mobile devices.
Primary Method: Using Custom CSS
The most universal way to customize fonts is by adding CSS code to your site. You can do this by navigating to Appearance → Customize → Additional CSS in your WordPress dashboard.
Examples of Effective CSS Code
1. Change Global Body Font Size and Color
To make all body text larger and black instead of the default light gray:
body {
font-size: 16px;
color: #000000;
}
2. Modify Heading Sizes
To reduce the size of all H2 headings site-wide:
h2 {
font-size: 20px;
}
3. Target Text in Specific Sections
To change the subtitle font size and description color in the Features section:
.section-features .section-subtitle {
font-size: 13px;
}
.section-features .section-desc {
color: #FFFFFF;
}
4. Change Menu Font
To customize the main navigation menu's appearance:
.onepress-menu a {
font-family: 'Helvetica', Arial, sans-serif;
font-size: 14px;
font-weight: 500;
color: #dd8b0f;
}
5. Adjust Link Colors
To change the color of all hyperlinks on your site:
a {
color: #your-color-code;
}
Advanced: Replacing Google Fonts for GDPR Compliance
For users concerned about GDPR, the theme loads Google Fonts from an external server. To use a system font stack instead and avoid external requests, use this CSS:
body, button, input, select, textarea {
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
h1, h2, h3, h4, h5, h6 {
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
Important Considerations
- CSS Specificity: Sometimes your CSS might not work because another style is overriding it. Using more specific selectors (like
.section-features .section-desc) is often more effective than using!important. - Mobile Responsiveness: Consider using relative units like
remoremfor font sizes to ensure they scale properly on different devices. - Child Theme: For more permanent changes, especially those involving PHP (like hosting fonts locally), creating a child theme is highly recommended to preserve your modifications after theme updates.
By using the Custom CSS area, you can significantly alter the typography of your OnePress site without needing to edit core theme files. Always remember to test your changes on different devices to ensure a consistent and accessible experience for all visitors.
Related Support Threads Support
-
Font Size in Pageshttps://wordpress.org/support/topic/font-size-in-pages-2/
-
How To Remove Google Fonthttps://wordpress.org/support/topic/how-to-remove-google-font/
-
How can I change font sizes and font color in Section Featureshttps://wordpress.org/support/topic/how-can-i-change-font-sizes-and-font-color-in-section-features/
-
Post fonthttps://wordpress.org/support/topic/post-font/
-
Change background-color of “blockquote”https://wordpress.org/support/topic/change-background-color-of-blockquote/
-
How to change the fonthttps://wordpress.org/support/topic/how-to-change-the-font-3/
-
Homepage: h2 in h3https://wordpress.org/support/topic/homepage-h2-in-h3/
-
Will not show Raleway light typography for heading texthttps://wordpress.org/support/topic/will-not-show-raleway-light-typography-for-heading-text/
-
Change Text color & Hyperlinked text colorhttps://wordpress.org/support/topic/change-text-color-hyperlinked-text-color/
-
How change font url to local files?https://wordpress.org/support/topic/how-change-font-url-to-local-files/
-
Changing link text color in the file blockhttps://wordpress.org/support/topic/changing-link-text-color-in-the-file-block/
-
Change in typography?https://wordpress.org/support/topic/change-in-typography/
-
Custom CSS for OnePress to change font size in content area?https://wordpress.org/support/topic/custom-css-for-onepress-to-change-font-size-in-content-area/
-
change headings in style sheethttps://wordpress.org/support/topic/change-headings-in-style-sheet/
-
where and how to change color of subtitleshttps://wordpress.org/support/topic/where-and-how-to-change-color-of-subtitles/
-
Accessibility (WCAG): Font Size, Contrast, no CSS/JShttps://wordpress.org/support/topic/accessibility-wcag-font-size-contrast-no-css-js/
-
How to change text font color for all pages and postshttps://wordpress.org/support/topic/how-to-change-text-font-color-for-all-pages-and-posts/
-
How to change text font size through onepress child themehttps://wordpress.org/support/topic/how-to-change-text-font-size-through-onepress-child-theme/
-
edit cta section fontshttps://wordpress.org/support/topic/edit-cta-section-fonts/
-
What font family does this theme use?https://wordpress.org/support/topic/what-font-family-does-this-theme-use/
-
Onepress / Change menu fonthttps://wordpress.org/support/topic/onepress-change-menu-font/
-
GDPR: avoiding external files access by Theme (Google Fonts)https://wordpress.org/support/topic/gdpr-avoiding-external-files-access-by-theme-google-fonts/
-
Change Font Sizes of H1, H2, H3https://wordpress.org/support/topic/change-font-sizes-of-h1-h2-h3/
-
Change font + color About sectionhttps://wordpress.org/support/topic/change-font-color-about-section/
-
Need H2 in H3 font sizehttps://wordpress.org/support/topic/need-h2-in-h3-font-size/
-
System Font Stack – Google Fonts disabled GDPR/speedhttps://wordpress.org/support/topic/system-font-stack-google-fonts-disabled-gdpr-speed/