• Hi people, I am having a very strange problem here.

    I’ve created a theme from scratch. I converted it to wordpress theme, and it is broken.

    Strange thing is I copied the whole Page Source of the broken theme from the browser (View Source) and paste it into a textfile and save as a normal html. It worked.

    Now come the frustrating part, from that html file (now clean from ALL traces of php codes since it is from View Source), I saved it as the index.php of my custom theme, guess what, the layout collapsed again! Even without a single line of php code, it collapsed, just because it is a .php file called by wordpress engine to become a theme. It looked completely fine when it is still a .html

    So I suspect something is wrong when wordpress calls my theme file. It messed up my css structure in between the process. But I donno how to fix it…

    Anyone got any idea?

Viewing 3 replies - 1 through 3 (of 3 total)
  • how do you link your css file, style.css?

    here is the corresponding code from the default theme:

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

    this links to style.css of the theme

    Thread Starter nders

    (@nders)

    yeah, it is style.css, the stuffs didnt break entirely, just about 10% of them breaks. but are the most important 10%… (the wrapper of which margin is set to 0 auto, but failed to center, and a few minor stuffs)

    I am suspecting the @import reset.css in my style.css doesnt run when the wordpress engine is calling the phps or the server processing the phps. is it possible?

    try to link style.css the way i sugested above,
    and link the reset.css in the following way:
    <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_directory’); ?>/reset.css” type=”text/css” media=”screen” />`
    and see what happens.

    the wordpress setup can be sensitive to relative file paths.

    you could also post the code from header.php where you link the style sheets, and someone might have a look at it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Theme breaks when converted to .php’ is closed to new replies.