• Resolved smileX

    (@smilex)


    Howdi!

    I′m stuck with a stupid problem really, I need to use a different style in one of my categories. I made some changes to my header.php file to load a different header-file if you′re in a certain category.

    In my new header file, all i did what this change:
    <link rel="stylesheet" href="newstyle.css" type="text/css" media="screen" />

    However, this does not work. My category does not get any stylesheet at all.
    Someone who could explain this to me?

    Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Well first, remove the <strong> tags in the middle… maybe that came over with your post accidentally, but it should look like:

    <link rel="stylesheet" href="newstyle.css" type="text/css" media="screen" />

    Then you need to add a function to point WordPress to your theme directory:

    <link rel="stylesheet" href="<?php get_template_directory(); ?>/newstyle.css" type="text/css" media="screen" />

    That should hook it up properly provided newstyle.css is located in the main theme directory.

    Thread Starter smileX

    (@smilex)

    Hey sixhours, thanks for helping me out.

    Yeah, the strong-tags is not in my actual code.

    I tried out your code, did not work either. Yeah, all files are located in the main directory. Checked all file names and everything looks correct.

    Any other ideas?

    ***EDIT:***
    When I changed get_template_directory to template_directory it works just fine.

    Glad it (sorta) worked!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom stylesheet not working?’ is closed to new replies.