Support » Themes and Templates » stylesheet and index not linking

  • Hi

    I’m creating a new theme and I’m having trouble linking the stylesheet and the index file. I’m also completely new to WordPress.

    Here’s the code for the Stylesheet and the Index. Thanks.

    /*
    Theme Name: HANNA
    Theme URI: http://localhost/wordpress/
    description: A sample wordpress theme
    Version:1.0
    Author: Zakia
    Author URI:http://localhost/wordpress/
    Tags: Fairy,tale
    */
    #wrap{
    }

    Here’s the code for the index:

    <!DOCTYPE html>

    <html>
    <head>
    <title><?php bloginfo (‘name’);?></title>
    <link rel=’stylesheet’ href=’xampp/htdocs/wordpress/wp-content/themes/Hanna Theme/style.css’ type=’text/css’ media=’screen’/>
    </head>

    <body>
    </body>

    </html>

Viewing 5 replies - 1 through 5 (of 5 total)
  • That’s not a space in your URL is it? Looks like you named your theme directory “Hanna Theme”. Spaces do not work in URLs.

    Also, case matters on some servers. That is, ‘Hello’ does not equal ‘hello’. You should be careful with uppercase and I’d recommend avoiding it in file names and URLs.

    And you started the URL too ‘early’. Your web root should ‘xampp/htdocs/’. That is where your URL should start– ‘/wordpress/wp-content/themes/hannatheme/style.css’

    Finally, what you have got is a relative URL. WordPress, because of the way it conspires with the web server to lie about the directory structure, does not work well with relative URLs. You should use absolute urls– ‘http://localhost/wordpress/wp-content/themes/hannatheme/style.css’. That is what the bloginfo() function is for, along with some other template functions.

    Hi

    Thanks for answering…
    I’ve done all of that but it went to the ‘cheatin’ uh’ page.

    I’ve also started another theme from scratch, following this exact video tutorial (as before) and it still doesn’t work – http://blog.themeforest.net/wordpress/wordpress-for-designers-day-3/

    In Firefox, it just says no CSS properties when I use Firebug. In Chrome, no css shows up at all in the page source.

    Totally stumped!

    I’ve done all of that but it went to the ‘cheatin’ uh’ page.

    What is the URL that gets you to that page? And what is the URL after your get there?

    Hi – I actually didn’t bother recording that – and I’ve now scrapped it. Sorry that’s not very helpful.

    I started anew again – here is the code for style and index. I’ve followed all the rules in the above tutorial but the page just doesn’t show the css element in source:

    /*
    Theme name:zakia
    Theme URI:http://localhost.3306/wordpress
    Description: A sample wordpress theme for my blog
    Version:1.0
    Author: Zakia
    Author URI:http://myculturalstrife.tumblr.com
    Tags:personal, blog, minimal
    */

    #wrap {

    }

    <!DOCTYPE html>
    <html>
    <head>
    <title>This is the first page</title>
    <link ref=”style” href=”http://localhost/wordpress/wp-content/themes/zakia/style.css” type=”text/css” media=”all”/>
    </head>

    <body>

    </body>

    </html>

    Look at the source of this page:

    <link rel="stylesheet" href="http://s.wordpress.org/style/wp4.css?26" />

    It should be ‘stylesheet’, not ‘style’. You’ve got to mind the details. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘stylesheet and index not linking’ is closed to new replies.