What you are experience is probably issue with something else. If you try and access this link:
https://fonts.googleapis.com/css?family=Roboto:300
Directly, you can see that all the font families have a normal style. You might have another CSS rule overriding them. Check for that, and also refresh your browser’s cache.
The second note is, you are only registering the styles. You have to also enqueue them using wp_enqueue_style
. So your code should be like this:
function google_fonts() {
$query_args = array(
'family' => 'Roboto:300'
);
wp_register_style( 'google_fonts', add_query_arg( $query_args, "https://fonts.googleapis.com/css" ), array(), null );
wp_enqueue_style('google_fonts');
}
add_action('wp_enqueue_scripts', 'google_fonts');
Right now I’m guessing you are using some other enqueued google font.
Related Posts:
- Best way of adding CSS which can be manipulated by the user via theme option panels?
- Using PHP to toggle stylesheet and header image, set in cookie
- Shortcode content output but not in correct place
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- How to style options page in dashboard?
- Css loads very slow [closed]
- responsive.css in the WordPress should be prioritized
- height should be set to auto to avoid pixelation in the post thumbnail function
- How to make container class in PHP
- Creating a mobile site by adding a new class to the body tag from functions.php
- CSS change in woo commerce Place Order Text [closed]
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- how to changes mobile menu toggle breakpoint in WordPress
- PHP function for horizontal Woocommerce thumbnails and badges
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- I got big white screen when i attach main style sheet of Html in functions.php
- Site title not showing. Please help me
- PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)
- Add class for the_post_thumbnail_caption()
- Displaying POST content with HTML tags and all
- Highlight Single Page Ancestor
- Styling admin page rows in order of importance (checkboxes)
- How to have Function of a plugin using global vars into a shortcode?
- Cant get theme to change footer color through theme customizer
- How to add margin underneath woocommerce total price amount -> productpages
- Integrating CSS Into a WP Function Call [closed]
- Load slideshow.css file only if Slideshow is checked / on
- Sorting Problem
- Customize default settings on new sites on multisite
- Check if a menu is empty?
- the_author_posts_link css class
- Remove class that has been added by parent theme
- Setting up the child theme so as to enable right-to-left WordPress?
- Design view breaking on Pages
- Hooking new functions to actions + passing parameters
- How to display a value from a radio button in the options menu in wordpress
- How to break down importing of feeds
- How to scale image with equal width and height without distortion?
- php syntax – how to concatenate properly – echo bloginfo(‘stylesheet_directory)
- Create Logout Link WordPress Admin Menu
- Use wp_get_recent_posts with search term
- Calculations in functions.php [closed]
- Choose To Display Post Views With An Options Panel
- Prevent Data Resubmission On Page refresh
- Get_avatar filter?
- register_taxonomy() take much queries
- Whats the proper way to use a php stylesheet in a wordpress theme? [duplicate]
- is there a benefit in using a constant over get_stylesheet_directory_uri?
- WooCommerce Tabs [closed]
- Shortcode with PHP issue “Undefined index”
- Override a function defined in wp-includes/comment-template.php
- Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?
- Displaying posts based on category
- Clickable image link sends people to wrong URL
- Countdown to date function?
- calling a custom field value inside functions.php
- Custom meta box values are not getting saved for my custom post type
- Noindex Posts From Certain Authors In WordPress
- WordPress check if current taxonomy has child
- get post id from wp_insert_post for get_template_part
- This function is deprecated; use mysql_real_escape_string() instead
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- Custom Taxonomy Select Menu: Setting default option value?
- How to add author’s posts link (HTML + PHP) inside a function to output it
- Enqueueing a code block from an options framework
- Assign Custom classes to every Excerpt
- Conditional On custom field plugin metabox
- Adding a ‘style=’ bit to image_send_to_editor output
- Post Views Code Hacks
- Closing WP_LINK_PAGES DIV ID w/After Argmuent
- Exclude function from running on a certain page
- Auto create Nextgen Gallery on post creation [closed]
- Adding a navigation page state to individual blog and portfolio pages
- Hide media for non logged in users
- Inline CSS header style priority function.php Child (no enqueing I think)
- How to set value selected using select2 jquery plugin
- Jetengine Forms – Media upload path
- Using ACF Relationship field to set post type to draft or published status
- is_front_page is not working in my functions.php
- Is it possible to update the dataset using update_post_meta
- Hide payment method based on user role AND minimum cart value
- How can i avoid duplicate same post in wp?
- Update $wpdb query with AJAX
- how to use auth_redirect() redirect visitor to login page if they are not login when they click account and order page?
- how to add functions to my function.php using a child theme?
- Replace header with large image on home page only, using Genesis child theme
- All categories options or All categories not Populating
- WordPress load javascript file if something… (after the page is loaded)
- Wrapping shortcode content in a span or link
- Hide button based on PHP result
- Permission functions within wordpress
- Adding ID to a Listing but not inside WP_Query while
- Child theme not working properly
- WordPress display name string manipulation
- 2 small questions: How to redirect to a created page & show that pages title in wp, bp
- Particular meta tag – viewport – insertion when dealing with plugin
- how to loop through blog posts in php
- Hide category by tag
- add_rewrite_rule image from /images/site2/favicon.ico to /favico.ico
- Background Tasks in a WP Cronjob?