• Hi:
    New to WP. Trying to develop my own Theme, using WordPress 2.8 Theme Design book by Tessa Blakely Silver.

    I have created the design and have the html/css files loaded in a new theme directory (with an images file and style.css, and a flash file). I can pull up the unstyled XHTML but I cannot get the page to read my stylesheet in WP.

    I can’t tell if there’s a typo in the book because the publisher’s site appears to be down and I can’t get to any errata.

    Per her book, the head code is supposed to read:
    <style type=’text/cs’s media=’screen”>
    @import url(“<?php bloginfo(“stylesheet_url”); ?>”);
    </style>

    Is the /cs’s a typo? When I enter the code like that the page won’t come up at all.

    When I enter the code as:
    <style type=’text/css” media=’screen”>
    @import url(“<?php bloginfo(“stylesheet_url”); ?>”);
    </style>
    I at least get the unstyled page up.

    My page can be seen at: https://www.thdesigninc.com/wptrial/

    Can anyone give me the proper coding to connect the stylesheet (style.css) to the page?

    What it’s supposed to look like is at: https://www.thdesigninc.com/inprogress/THD/index.html

    Many thanks for any help!

Viewing 10 replies - 1 through 10 (of 10 total)
  • You have mismatched quotes here:
    'text/css" media='screen"

    It should look like this:
    "text/css" media="screen"

    Thread Starter vytaulla51

    (@vytaulla51)

    ThankS very much!

    I was wondering about that, but that how it’s written in the book. More than once! And the “/cs’s” was wrong too, wasn’t it?

    I changed as you indicated and now some of the styling appears. None of my graphics are loading though. They are in a folder named “images” which is at the root level –

    Am I getting ahead of myself? Will I need to be adding some kind of coding for my graphics to load? (I’m only in chapter 3 of the book, but I’m under the impression that my graphics should be showing up, but not the Flash file yet.)

    You should put your images folder in your theme folder….it will make your life much easier later.

    Thread Starter vytaulla51

    (@vytaulla51)

    Hi:
    My images folder IS in my theme folder. I meant at the root level of the specific theme folder. The theme is called lamarsson; lamarsson is at wp-content/themes/lamarsson, and in lamarsson is: images, index.php, favicon.ico, style.css

    Thanks –

    When referencing a directory in the php files, use this:
    <img src="<?php bloginfo('template_url'); ?>/images/image.jpg" alt="alt text" />
    otherwise, it will look in yourdomain.com/images/image.jpg

    If you are referencing directories in the css file, you can leave it as images/image.jpg (relative to the css file location).

    Thread Starter vytaulla51

    (@vytaulla51)

    I’m sorry, I’m not understanding.

    Right now there’s no templates, I just have the entire page on index.php. So, for example, the logo should be at the top of the page. The coding currently says:

    <div id=”header”>
    <img src=”images/logo.jpg” alt=”” height=”76″ width=”280″ border=”0″ />
    </div>

    What should be different?

    BTW, thanks for reminding me to add the alt text!

    Change that section to:

    <div id="header">
    <img src="<?php bloginfo('template_url'); ?>/images/logo.jpg" alt="" height="76" width="280" border="0" />
    </div>

    Thread Starter vytaulla51

    (@vytaulla51)

    Okay!!! Yep!

    So I needed the php code to call the images!

    Now, when I proceed to separate out the header into a template, and the sidebar into a template, etc., will I need to change the coding again for relevant graphics? Or is this generic “get image” coding as long as the graphics are in that images folder?

    Thanks!!

    You shouldn’t have to change anything as long as you keep your images in a directory inside your theme’s directory.

    In your current case, the code <?php bloginfo('template_url'); ?> translates into:
    https://www.thdesigninc.com/wptrial/wp-content/themes/lamarsson

    but if your moved you theme to another folder, it wouldn’t matter, the code would know where your “template_url” is and will react accordingly.

    Thread Starter vytaulla51

    (@vytaulla51)

    Thank you so much for your help! Hope you have a great day!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘attaching style.css file properly’ is closed to new replies.