If they are inline, your image paths should be /wp-content/themes/theme_name/
and then whatever the directory is in.
Since you are already loading them via file_get_contents()
, why not do a search & replace and use the full URL for them? With proper caching, this shouldn’t make any impact on the load time itself.
The usual way is to enqueue your styles via wp_enqueue_style()
. Plugins like W3 Total Cache or WP-Optimize offer solutions to merge all those loaded styles – this will only work if you properly enqueue them and not if you inline them.
Related Posts:
- wp_head() gives me some weird CSS
- Deregister CSS style link ‘open-sans-css’
- wp_head function causes 30px blank space [closed]
- Remove Genericons Helper CSS from twentyfourteen theme
- Display Something in the Header After All Styles are Loaded
- Remove CSS & JS from
- Where are the contents of WP_Head
- unable to override style block within wp_head()
- How to add css to wp_head depending on the user role?
- Customize Bootstrap checkboxes
- What is WebKit and how is it related to CSS?
- Is there a color code for transparent in HTML?
- How can I center an absolutely positioned element in a div?
- How to override the properties of a CSS class using another CSS class
- css transition opacity fade background
- Text-decoration: none not working
- Aligning two divs side-by-side
- CSS transition shorthand with multiple properties?
- How to center HTML5 Videos?
- Using custom fonts using CSS?
- How can I transition height: 0; to height: auto; using CSS?
- Display Images Inline via CSS
- Why CSS3 Animation is not working?
- Why is my Bootstrap code not working?
- What is the difference between visibility:hidden and display:none?
- Center a position:fixed element
- How to make canvas responsive
- How to change version of .css in WordPress?
- Disable SSL / HTTPS for wordpress
- Forcing reload of editor-style.css
- How can I make the wordpress editor apply the selected template?
- How do I remove specific styles from the parent theme css using the child theme css?
- What CSS rules are introduced to core blocks through wp-block-styles?
- How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?
- When using https, wordpress doesn’t use https for CSS and JS, and admin doesn’t work. How do I fix this?
- How to load different css file depending on language
- Can the Theme Customizer be used to generate static/cachable CSS, and how?
- Woocommerce include custom stylesheet after woocommerce styling [closed]
- raw code vs wordpress
- Inconsistent `body_class()` function
- Is there a way to change the backround color of the native video player in wordpress?
- How to create fa-bars animated menu
- Only column gallery on mobile device
- footer disappear on some pages frequently
- Changing CSS FilePath for All Pages
- CSS Minification
- show count is out of the anchor tag in wp_list_categories
- jQuery UI styles conflicting with TinyMCE dialog
- Why won’t my custom login page CSS load?
- wordpress – site not update after update style.css
- NGINX+wordpress: CSS being served but not applied
- Menu toggle bar works only on some pages in WordPress
- After moving my site, sub-menus are not showing [closed]
- Including CSS files in HEAD based on page content
- Video header on mobile, disappears behind header and content
- Use Google Fonts and unicodes
- Conditionally print css style in WordPress
- Adding elements to wp_list_pages (within , but before )
- WordPress is not displaying CSS file
- Change class names dynamically added to html elements by wordpress
- Page versus post ID specific CSS ID?
- Why doesn’t WP recognize images in posts like other content? [closed]
- Chat window hiding behind Twenty Eleven header
- CSS for the main top menu appears to have stopped working after All-In-One Migration transfer
- Css will not display in webpage, after adding it in style.css in child theme
- Hide Tab Titles from Tabs Block
- Hide product variations at home page
- wp_list_pages two columns
- TinyMCE on frontend style not working
- Bootstrap Integtration
- H2 On Blog/Article Page Gets Assigned a Class
- HTML not resizing
- Style not being applied to newly installed themes
- Make Responsive Specific Page in WordPress
- How to get homepage div container of wordpress website to display full width? [duplicate]
- CSS in child theme to replace !important in parent theme
- How would I add this code to a single WordPress page?
- WP theme update causes child theme CSS problems
- Wesbite super slow on iphone / very fast on desktop with same connection on wifi
- adding a favicon to site2 – site1/site2/favicon.ico
- WordPress crop image not working [closed]
- Which files can be replaced in a child theme?
- How to implement styling of div in the front end using plugin admin meta box settings?
- How do i make a sidebar background color? [closed]
- How to remove audio player styles added by mediaelement.js JavaScript?
- CSS messes up when CACHE is cleared
- Twenty Fourteen Theme – Moving left sidebar to the right
- WordPress doesn’t respect “ver” parameter in styles [closed]
- why does WordPress custom css convert alpha to hex values?
- Image is very blurry
- how to change the colour of this background
- Can I upload my HTML/CSS/Javascript game onto a WordPress page?
- can i custom rendered content from API?
- How enqueue CSS out of theme folder?
- Styling not refreshing for old visitors on WordPress
- How to include Elementor CSS in custom php file [closed]
- How to add CSS to WordPress
- How to add arbitrary custom CSS to a WordPress Block Theme using Site Editor?
- Wrap post titles containing slashes on narrow viewports
- Import css file from node_modules using @wordpress/scripts