You just need to add the styles directly to the page head. The best way to do this is to use the ‘wp_head’ action hook, assuming you are using a theme that has the hook. Like so:
add_action('wp_head', 'my_custom_styles', 100);
function my_custom_styles()
{
echo "<style>*{color: red}</style>";
}
Check out the WP codex to learn more about action hooks.
Related Posts:
- How important is it to enqueue a theme’s stylesheet?
- Enqueue a stylesheet for login page and make it appear in head element
- Why I can’t add a CSS style in this WordPress theme?
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- Adding customizer styles with wp_add_inline_style
- What can I hook into after_setup_theme?
- Identifying the priority of style.css so I can make a small CSS file load last
- Adding inline styles from a widget
- The best way to add stylesheets to WordPress
- Advantages of using instead of wp_enqueue_style()?
- How to add dynamic inline style?
- Enqueued Stylesheets Effecting Admin Styles
- De-registering parent style sheet css recommended?
- enqueue_style is not working
- Dequeue a style file which is making website load slow!
- Is my approach to enqueue styles inefficient?
- Child theme style.css versioning
- Disable wp_enqueue_style for theme on wp-admin
- functions.php not hooking up with style.css
- How can I let templates choose which stylesheets are enqueued?
- Stylesheet not linking
- Theme Loading Into Dashboard
- How to check if a WordPress core block is active in sidebar
- Font Awesome 5 Free – far working but fas is not? [closed]
- How remove render blocking css from wordpress when you build a theme?
- filemtime(): stat failed warning within a child theme
- How do I use a color from theme options?
- How to remove ID’s from wp_enqueue_style?
- Ideal inline dynamic CSS injection
- How to include a file only on dashboard widgets page?
- Having issue with WordPress wp_enqueue_style
- theme style is applied on the dhasboard rather than the website
- Are there any caveats to compiling all of my theme’s SCSS into the style.css file in the theme root?
- Adding google fonts to WordPress theme
- Displaying front side empty with one file attached problem
- Find out the reason that the Styles and scripts in the theme are loading properly in localhost but Not in server after deploying
- Using wp_add_inline_style Inside a Template File
- Different stylesheet for different pages not working fully
- How to output wp_enqueue_style() in HTML head instead of footer
- Enqueue script/style with multiple GET parameters
- How can I add a URL field to the attachments window?
- WP 3.4 – what action/hook is called when theme customisation is saved?
- Display admin notice only on main dashboard page
- Is the theme customizer slowing down my site?
- What is the best book to learn how to make themes for wordpress?
- Multiple Custom_Background, is it possible?
- Use theme folder instead of plugins_url
- Setting hero/splash section as a blog post
- posts_nav_link(); not showing up on static pages
- Loading files for theme and child theme (Require)
- How to display the content for given page ID withot the wrapper?
- Develop new theme without affecting the active one
- How to add categories to wp_list_pages()
- Move theme templates to subfolder without losing page associations
- Can’t delete theme
- How to add a download link to a movie from WP media library?
- Is it a bad practice to use switch_to_blog in the frontend?
- Arguments ignored/markup changed in wp_nav_menu if no menu is selected
- WordPress custom post type permalink: website.com/post-name/post-id
- paged > max_num_pages won’t throw 404
- Execute upgrade-theme with coding
- Theme Javascript.php Overwritten Nightly [closed]
- Is there a way to visualize / print out which templates were used to render a given piece of UI?
- How to use widget in a widget-less WordPress theme?
- SVG in list-style-image breaks when adding fill
- What template file is used for homepage pagination?
- Alignment Problem [closed]
- Clearing dummy data before launch
- Multiple editable areas
- Converting a static HTML template into a WP theme – How do I specify page content?
- Unwanted empty line at the beginning of document
- How to display date of blog creation
- Translate a theme with a PO file
- All pages are the same
- Theming media inserts
- How to Split loop in multiple column in archive page
- wordpress script_loader_tag in function.php
- Why not works the search.php file?
- My wordpress theme name isn’t updating straight away
- Warning: This page allows direct access to your site settings. You can break things here. Please be cautious!
- Adding a second logo next to the main one in header
- Looking to create an “update theme” functionality for a custom front-end dashboard
- How to get next post and previous post URL in loop, single.php My WordPress 4.9.6
- Import settings from another theme
- Load multiple css simultaneously using functions.php
- bbPress: modifying template for forum index
- control posts order by select option
- Nav menus Fast previewing not working with wp_get_nav_menu_items!
- How to Apply Category Filter to Pagination
- How do I use the add_query_arg function in a template tag like previous_post_link?
- Load get_page_templates into select menu
- Let users to add any number of input fields in the theme option page
- Add custom field to existing meta box?
- Theme Options Doesn’t Work On WP Multisite
- WordPress two sidebar layout or theme
- add_action not working in header?
- Standard Way To Do Custom Work Within A Page?
- Subsite theme mystery man replacement with Buddypress on main site [closed]
- Recent posts with comment count in “Sidebar” template [closed]
- My theme is full of error messages in the “Customize” screen, but nowhere else