-
-
- Submit Updated Articles to Bing and Yandex with IndexNow in Joomla
- Add Published and Modified Date Meta Tags to Joomla
- Add Open Graph and Twitter Card Tags to Joomla
- Auto-Generate Meta Descriptions from Article Text in Joomla
- Add Noindex to Specific Pages in Joomla
- Verify Your Joomla Site with Google Search Console
-
- Add a View as Markdown Link to Joomla Articles
- Display the Last Modified Date in Joomla Articles
- Embed Iframes in Joomla
- Automatically Link Twitter (X) @mentions in Joomla Articles
- Open External Links in a New Tab in Joomla
- Display Estimated Reading Time in Joomla Articles
- Replace Old URLs in Joomla
- Search and Replace in Joomla
-
- Add a Footer Line to the Joomla Administrator
- Show a Staging Banner in the Joomla Administrator
- Remove the "All" Option from Admin List Limits in Joomla
- Add a Cookie Consent Banner to Joomla
- Make the Administrator Navigation Sticky in Joomla
- Add Google Fonts to Joomla
- Add a Facebook Messenger Chat Button to Joomla
- Add a Reading Progress Bar to Joomla
- Add a Custom Scrollbar to Joomla
- Show Confetti on a Thank You Page in Joomla
- Add Smooth Scrolling to Joomla
- Add a Back to Top Button in Joomla
- Add a WhatsApp Chat Button in Joomla
-
- Protect the Administrator with a Secret URL Key in Joomla
- Show a Welcome Message on First Login in Joomla
- Log Out Idle Administrators in Joomla
- Assign New Users to a Different User Group Automatically in Joomla
- Redirect Visitors by Country in Joomla
- Redirect Users After Login by User Group in Joomla
- Block User Registration with Certain Usernames in Joomla
- Block User Registration by Country in Joomla
- Block User Registration by Email Address in Joomla
- Block User Registration by IP Address in Joomla
- Remove the Forgot Password and Username Links in Joomla
- Remove the Generator Meta Tag in Joomla
- Let Users Log In with Their Email Address in Joomla
- Block Traffic by Country in Joomla
- Block Bot Traffic in Joomla
- Block Traffic by IP Address in Joomla
Add Google Fonts to Joomla
Give your Joomla site any typeface from Google's library, applied to body text and headings without touching template files, using one HTML snippet.
Your template ships with one typeface, and swapping it means editing template files that the next update overwrites. Google Fonts has over 1,500 families you can load with a single link tag. You can add Google Fonts to Joomla with one HTML snippet in Code Snippets.
The HTML snippet code
The snippet loads the Inter family in 3 weights from Google's servers and applies it to body text and headings. The 2 preconnect lines let the browser open the connection early, so the font arrives sooner.
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap">
<style>
:root {
/* Cassiopeia, the default Joomla template, reads these 2 variables. */
--cassiopeia-font-family-body: 'Inter', sans-serif;
--cassiopeia-font-family-headings: 'Inter', sans-serif;
}
/* Other templates: set the font on the page directly. */
body,
h1, h2, h3, h4, h5, h6 {
font-family: 'Inter', sans-serif;
}
</style>
To use another family:
- Open fonts.google.com and pick a family.
- Select the weights you need and open the Get embed code panel.
- Copy the
<link>lines into the snippet in place of the 3 lines at the top. - Replace
'Inter'in the CSS with the family name from the CSS class section of the same panel.
Cassiopeia, the default Joomla template, reads its fonts from the 2 variables in the :root block, so the font applies everywhere at once. The body rule covers templates that don't use those variables. To use different fonts for headings and body text, load both families and set each variable to its own font.
How to add this snippet
- Install Code Snippets if it isn't installed already.
- Log into your Joomla backend.
- Go to Components → Tassos Code Snippets.
- Click New.
- Enter a title, for example Google Fonts.
- Set Code Type to HTML.
- Set Insertion Method to Auto-Insert Locations.
- Set Location to Site Header.
- Paste the code above into the editor.
- Click Save & Close.
Check that it works
- Open any page on your site. The text already looks different if your template used another typeface.
- Right-click a paragraph, choose Inspect, and open the Computed tab in the browser's developer tools.
font-family reads Inter, sans-serif, and the Network tab shows font files downloaded from fonts.gstatic.com.
To learn more about HTML snippets, read the HTML snippet docs.