I believe using wp_enqueue_style()
is basic and more appropriate.
If you wanted the stylesheet to only be referenced on a particular page template then you do this
if ( is_page_template('template-directory/template-name.php')) { wp_enqueue_style( 'theme_css', get_template_directory_uri() . '/directory/filename.css'); }
or you just do this if it is not specific to a page template.
wp_enqueue_style( 'theme_css', get_template_directory_uri() . '/directory/filename.css');
This piece of code will need to go in your functions.php file. Read more about it here -> https://developer.wordpress.org/themes/basics/including-css-javascript/#stylesheets
You also want to be careful about the order in which you have referenced your css files -> In which order do CSS stylesheets override?
Related Posts:
- WordPress Salient theme: getting a full width 2 columns portfolio
- The requested URL /about was not found on this server
- CSS background images in WordPress
- Redirect after Login on WordPress
- How to remove unwanted space in wordpress OMG Blog theme?
- WordPress asking for my FTP credentials to install plugins
- WordPress asking for my FTP credentials to install plugins
- WordPress how to remove blocksy theme price and put my own price
- In WordPress Using Elegant Theme’s Divi Theme, Long menus don’t show
- WordPress: How to overlay text / widget div on top of a revolution slider
- Links not clickable on mobile devices in WordPress
- Find source of Google Fonts in WordPress
- How do i download code files of the website from wordpress.com?
- Astra Pro theme for WordPress why isn’t logo showing?
- language flags (Image links) with css not work in WordPress costum theme
- Is it possible to combine a WordPress template (Semplice) and some HTML & CSS pages?
- WordPress Email Share button not opening in Outlook
- how do u change the link color of one specific link in wordpress?
- Embedding a Square Appointments script into a WordPress site – it’s rendering fullscreen in the preview pane, so I can’t edit other content. Thoughts?
- how to create a custom live search in WordPress from scratch
- Changing code font size on wordpress
- WordPress website broken in Facebook mobile browser
- How to find HTML rendered by in WordPress?
- Local wordpress install only shows home page, all other pages Not Found
- how to add gravity forms to blog page(posts page) in WordPress
- Oxygen Builder with theme in WordPress
- Internet Explorer 8 issues with WordPress 3.8
- Internet Explorer 8 issues with WordPress 3.8
- Set size of WordPress thumbnail post
- Divi Child Theme Breaks WordPress Customizer
- Lucida calligraphy font not working wordpress site in android chrome
- How to apply font on WordPress?
- In wordpress how can I scrape and show social media data of users like in upfluence.com and shoutcart.com?
- Cuelinks widget’s half part is getting hidden on WordPress website
- How to change “Leave a Reply” title in wordpress twentyfifteen theme
- Custom CSS on WordPress parent and child pages
- WordPress- url for localhost wp-admin is not working
- WordPress- url for localhost wp-admin is not working
- Muffin Builder has a limit? (WordPress – Be Theme)
- WordPress “Save Draft” fails: “the response is not a valid JSON response”
- How to use wp_mail() function in wordpress
- Where to start in the WordPress codex?
- How to correctly use get_template_directory_uri() WordPress function to load an image that is in a subfolder of my theme?
- Correct way of using wp_get_attachment_image() in wordpress
- Custom CSS in WordPress messing up
- Woocommerce variable products: Sorry, this product is unavailable. Please choose a different combination
- Proper way to get page content
- WordPress admin bar not showing on frontend
- How can I make my header image properly responsive?
- How do I use WordPress with HostGator?
- google my maps ~ custom map embed into wordpress
- google my maps ~ custom map embed into wordpress
- WordPress plugin install: Could not create directory
- How to prevent attacks on WordPress wp-login.php page
- Using WordPress on 000webhost.com
- Add CashU payment gateway to WordPress Woocommerce
- How can I block doubleclick.net cookie from my wordpress website?
- Moving WordPress from MAMP to WAMP, can’t access pages
- Advanced Custom Fields, Yoast SEO, not updating new values in WordPress
- Safely redirect old WordPress blog links to new WP blog
- WordPress – How do I remove meta generator tags?
- WordPress sort WP ULike posts in custom query?
- jetpack is in offline mode in wordpress. how to enable it and connect to our wordpress.com account
- Create Online template maker in wordpress website
- How can I removed Powered by WordPress link in wp.login.php without editing core WP files?
- How to remove link from header navigation within the Astra theme for wordpress?
- WordPress theme creation : There are no widget areas on the page shown
- Send both HTML and Plain Text emails using wp_mail in wordpress
- How to download wordpress source code?
- WordPress PHP proxy/helper pages for Twitter API
- WordPress: Loading multiple scripts with enqueue
- Display all post meta keys and meta values of the same post ID in wordpress
- How to transfer HubSpot blog to WordPress?
- wp-admin vs wp-login in wordpress
- Automated Drip/ WorkFlow Form using a Plugin for WordPress site, or using a 3rd party
- how to parse wordpress post_meta table values
- how to parse wordpress post_meta table values
- Hide wp-login.php as log-in and redirect it to a custom login page
- How can I access http://localhost/wordpress/wp-admin/install.php?
- W3 Total Cache WordPress plugin disturbing my page layout
- Exclude tags from gatsby-source-wordpress-experimental
- removing a link from a date in wordpress
- How do i give a WordPress editor access to the Site Kit by Google plugin?
- cannot change admin password, wordpress on godaddy
- How can tune MySQL for WordPress sites?
- How to add “Edit Shortcuts” icon to WordPress customizer
- WordPress get_template_part pass variable
- Get the WordPress attachment image url
- Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php
- WordPress Multisite – Mature Option – What does it do?
- Pi Hole with web interface and wordpress on the same Raspberry Pi 4
- How to force a custom font to apply in wordpress OceanWP theme?
- Free, editable calendar for WordPress site that using Elementor?
- WAMP and WordPress duplicator plug in doesn’t work ( but works on MAMP )
- UpdraftPlus WordPress plugin is not working to store Backup in the Google Drive
- Amazon Workspaces VM prevented from logging in to WordPress on DreamHost
- What could be causing forced SSL on WordPress Login page? (ERR_SSL_UNRECOGNIZED_NAME_ALERT)
- Problem getting data with WooCommerce/WordPress
- Display all post meta keys and meta values of the same post ID in wordpress
- How to cache/speed WordPress queries for logged in users?