How do I include a css file while creating a wordpress theme?


Tags: php,css,wordpress,header,stylesheet

Problem :

I'm trying to create a wordpress theme. After following some tutorials I've written this in my header.php

<link href="<?php bloginfo('stylesheet_url');  ?> " rel="stylesheet" type="text/css" media="screen" />

I have one CSS file, styles.css, in the same folder as the index.php. What I have id weirdly calling CSS from somewhere, but not from the style.css file. How do I make it call all its styles from the styles.css file?? Thanks : )



Solution :

Might be a good idea to check the output of the bloginfo('stylesheet_url'); function (say, by echoing it out somewhere) and see wether it actually points to your stylesheet. You can always use bloginfo('stylesheet_directory'); and add a filename to link to another file in the same dir.


    CSS Howto..

    How to prevent opening a link of the submenu when tapping the menu?

    how to apply background transparency on a div (for an AJAX loading animation)?

    Setting a revealing onhover behaviour for multiple elements-pairs with only CSS - how come this works?

    how to read value of style[“display”] property of webcontrol

    how to add more specificity to css class .background-color-blue so it overrides default div's background color

    How to not send images to mobiles in a semantic manner

    Using CSS, how to rotate a 3D box 180 degrees on mouse enter and continue to 360 on leave?

    How can I find which file or code affected to my code in html, css

    CSS: How do I shrink a div to beyond a font's invisible padding?

    CSS: How to create colsgroup like semantic-ui way

    How to expand vertically web's body when open menu

    How can i add a css rule for this code?

    How can I style a button to look the same as the home button in Google Chrome with CSS? [closed]

    Disable the centring image function in a slideshow plugin?

    How to implement block style for list

    How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?

    How can I push to the top an element using slideUp?

    CSS how to postiton div outside main container without it moving over the container on window re-size? [closed]

    How to add JS to Wordpress and reference CSS or other scripts?

    How to center post title in blogger. (tried applying CSS)

    How to wrap UL list - LIs on new line with css

    Element has greater px width than device viewport but still shows completely (mobile web app)

    How to use “css” in the “jsp” in Spring MVC project?

    How do I use CSS with a ruby on rails application?

    How to draw rectangle on the website to highlight?

    How to know the correct css selector or group of selector for any html element quickly?

    CSS Cascading takes over inheritance, how to solve this?

    how to add several td and tr in css

    How to make span in bootstrap nav have width: 0px?

    how to give blur effect for css overflow visible content