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
- How do I make a shortcode to display Dokan seller badge list?
- How can we upload custom page files?
- Calling a PHP function from a menu item
- Hide or Show Read More Button by Content Area
- how to get permalink structure with php
- Woocommerce auto cancel On-Hold after X days
- Why does “get_option” pull in the older value in options.php, rather than the newer value, on submission of a form?
- Enqueue less file not working in child theme?
- Show last 5 posts from specific category
- Removing unnecessary wordpress files
- Change links automatically to affiliate links
- Use is_product_category() properly
- Theme Options: If There is No Input, Don’t Display?
- Placing raw HTML inside a WordPress shortcode
- Convert all images to PNG on file upload
- If search results empty then execute certain code
- An unwanted inline style is added to my body tag
- How to stop featured image thumbnail [set as background image] on blog index page just repeating same image across all posts
- Way to querry data (tags) from a wordpress database?
- Using fwrite() and “a” appends multiple times instead of once
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Selectbox in admin panel function linking to CSS
- How does WordPress insert Paragraphs in posts
- Making BuddyPress Activity Stream (Post Type) Featured Images Clickable [closed]
- what is the best practice to add new field to an api route
- Keyword checking in Gravity Forms
- how to refresh div on template part?
- Child page menu in sidebar
- Title Case WordPress Menu Items
- 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]
- Reduce size of responsive title
- REQUIRED: get_bloginfo(‘template_url’) was found in the file search.php. Use get_template_directory_uri() instead
- How to check if a PHP string is different than meta field?
- Displaying posts based on category
- Clickable image link sends people to wrong URL
- Noindex Posts From Certain Authors In WordPress
- Show all tags within a category?
- WordPress check if current taxonomy has child
- This function is deprecated; use mysql_real_escape_string() instead
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- Enqueueing a code block from an options framework
- Assign Custom classes to every Excerpt
- Adding a ‘style=’ bit to image_send_to_editor output
- Post Views Code Hacks
- Closing WP_LINK_PAGES DIV ID w/After Argmuent
- 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)
- Jetengine Forms – Media upload path
- 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
- 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?
- Using Sprit-sheet on WordPress categories
- How to include different html tags in the header for different pages?
- Wrapping shortcode content in a span or link
- Permission functions within wordpress
- WordPress display name string manipulation
- Changing 2011 theme header image based on user dropdown
- How to change a specific character in a theme option value – replace a space with a plus sign
- 2 small questions: How to redirect to a created page & show that pages title in wp, bp
- how to loop through blog posts in php
- Add multiple HTML attributes to an Elementor button
- /page/2/ redirect to 404
- require used as a function to load theme dependencies?
- Filtering with Attributes – how to display all non-queried products below query