• Hi… I’m a graphic designer attempting to code my first wordpress theme. I’m not able to figure this out. The html for index.php, single.php, page.php and a custom page (about.php) being the exact same (except for comments code in single.php), the CSS for index.php and single.php is loading properly, but not for page.php and about.php… i applied the about.php template in the template drop-down on About page editor… but still no change from the default CSS… can’t figure out what’s missing.

    The code for single.php (CSS loading fine)
    http://pastebin.com/CLLRBVch

    The code for about.php (CSS not loading)
    http://pastebin.com/fCh9rJA8

    Basically the CSS is loading for everything, properly, except the ‘Pages’.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter soumyasm

    (@soumyasm)

    i mean the css for the content/php part of the ‘Pages’ is not loading, everything else like header, footer, sidebar is loading properly.

    Use FireFox and the FireBug addon and look at the elements and applied styles, without a link to a test website it is hard to help!

    David

    why not use PHP to load the relevant CSS based on the page’s template?

    like so:

    <?php if (is_page_template('template-about.php')); { ?>
        <link rel='stylesheet' href='<?php bloginfo('template_url');
        /css-dir/about.css' />
    <?php } ?>

    obviously ‘template-about.php’ will be replaced with the name of your template and ‘/css-dir/about.css’ will be replaced with the relevant path to your own CSS file.

    hope that works for you!

    WR!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page.php and Custom page CSS not loading’ is closed to new replies.