As you probably know it’s always a good idea to register and enqueue your styles within you functions.php
.
As you can see in the Codex, there is a given order for the parameters of those functions. Simply put the data of the webfont in:
wp_register_style( $handle, $src, $deps, $ver, $media );
wp_enqueue_style( $handle, $src, $deps, $ver, $media );
So you’ll probably have something like this in your functions.php
:
function load_google_webfonts() {
wp_register_style( 'bree', 'https://fonts.googleapis.com/css?family=Bree+Serif' );
wp_enqueue_style('style', get_stylesheet_uri(), array('bree'), '1.0', 'all');
}
add_action( 'wp_enqueue_scripts', 'load_google_webfonts' );
Related Posts:
- How to create .pot files with POedit?
- What is the difference between wp_register_sidebar_widget and register_widget?
- How to enqueue script if widget is displayed on page?
- Custom Image section in Customizer
- Form Submitting Error with get_template_part()
- Get 10 posts from a WP_Query. If less than 10, get the remainder from elsewhere
- get_stylesheet_directory() returns wrong URI… localhost/using vhosts
- How Do I Programmatically Force Custom Permalinks with My Theme?
- wp_get_attachment_image_attributes not working for me
- Best practice (forward compatibility) for theme options
- How to use Plupload in themes
- add_editor_style not working
- what’s meaning of it when submit a theme?
- Returning Variables back into a template
- How to handle thumbnails
- WordPress Google Maps in Custom Theme
- How to add custom template tag in wordpress theme?
- Doubled titles when using All in One SEO with custom template
- In theme development, are there functions which write HTML in a standard fashion to reduce “spaghetti code”?
- Checking if there is an Image inserted – if not don’t display anything
- Retrieve data using wpdb to use for customizer controls
- Modify the Additional CSS section (adding a disclaimer)
- Creating directory and file using native wordpress file system
- Don’t understand why theming is so strange and twisted [closed]
- Create self-populating menu and add extra divs to the menu layout
- I want edit_post_link() to open in a new window/tab (target=”_blank”)
- wp_get_attachment_image_src() width and height boolean
- How to store functions in… functions.php?
- Is there a need for nonce with Post Metabox?
- Simple way to get two language WP site
- get_page_template returning nothing
- How can i initialize a widgetized sidebar (with widgets)
- How do you force a sidebar widget to have a container div around all child widgets?
- Add widgets to available widgets section without changing the theme?
- jQuery not available to other scripts
- Override template file i subfolders
- Theme Development for WordPress Multisite Installation
- Does the switch_theme action run when you’re upgrading a theme?
- How to obtain the html stripped version of $category->description?
- How to make animated intro?
- Replace custom logo with text
- WordPress Website Browser Compatibility issue with IE [closed]
- create category on theme setup
- StoreFront product pages: Turn the Short Description section into a kindred tab section [closed]
- How to jump to newly posted comment anchor after submit?
- WordPress get_template_part() function not working
- Recommended method for updating/adding menus when adding new theme
- How to add custom meta box under Gallery Settings in the “Edit Gallery” popup
- How to use add_theme_support(‘html5’)?
- Best way to develop a new theme on a live site, with new content? [closed]
- Tag Page Not Listing All Posts With Tag
- How do I make the most minimal vanilla theme possible with nothing but raw content?
- Remove link on full-size images
- How to reset post data properly
- Theme options save routine clashes with plugin save
- Contact Form Security
- Where do you add code in custom fuctions so it works on a specific page?
- Customizer Color Control Not Working
- get_search_query() not working with search queries with ampersand in it
- where to start with WordPress theme development [closed]
- Create a Grid/List Toggle in WordPress Archive
- If user is logged in and has a role echo statement
- Fixed button and slideshow in template upload per page
- Unable to add widgets to sidebars in custom theme
- Non-standard (new) theme file
- Best Practice for Server Processing
- How do I display a greyed out next_post_link when there is no next post
- MapPress Easy Google Map in Jquery Tabs Problem
- Homepage slider not using correct images
- WordPress Show Single Post on Home Page with previous/ Next Button
- Is there any way to store single.php wordpress file into a php variable
- Woocommerce AJAX filters option loading spiner – problem on mobile device
- How to change listing type permlink?
- How to Modify WP_Includes/blocks/latest_posts.php
- How can I show a custom WordPress menu anywhere I want on my website?
- Menu is in Reversed order
- How to connect two child themes on different sub domains to the same base theme
- Group several custom global page templates in sub-folder
- How to hide blog by id wordpress multisite listing
- Should I detect the device or the page first?
- Get chronological page order
- Query wp_postmeta into an array based on post_id
- Theme not uploading showing maximum upload size on live site
- WordPress Theme Developments – Start from another theme
- Access meta box checked value in another file
- How to override wordpress native options with theme options
- Best way to access variables in template markup
- How do I get my theme scripts to load in a custom theme built from Bootstrap
- Problem with multiple menus in theme
- How to convert that page to a wordpress template? [closed]
- JQuery Equal Height in Rows Conflicts Only Works without Registering wp_footer();
- Saving Permalinks Results in 403 MAMP (Windows)
- Add rel to all images in a post
- WordPress theme Modifications not showing up on live server
- Incorrect sidebar showing on WooCommerce Store page [closed]
- How to Create a Multi Purpose Theme?
- customize functionality of share buttons under each blog post [closed]
- white spaces on the all sides [closed]
- Add wrapper for a specific sub-menu
- Theme’s featured image option is not showing up