• Resolved buckza

    (@buckza)


    I’ve created a dynamic stylesheet and called in style.php

    I’ve put it in my themes/theme_name directory and deleted the style.css that was in there.

    Now it looks like it does not pick up the stylesheet at all.

    Where do I change the name of the stylesheet to style.php and not style.css? I think wordpress is looking for style.css and now can’t find it.

    Thanks in Advance

Viewing 6 replies - 1 through 6 (of 6 total)
  • Did you add this to the top of your style.php?:
    <?php header("Content-type: text/css"); ?>

    Also, to make WordPress look for the correct file, open your header up and add this
    <link rel="stylesheet" type="text/css" media="screen" href="style.php">

    Hope that works

    Alex

    Thread Starter buckza

    (@buckza)

    Thanks for the quick replay back

    I did add <?php header(“Content-type: text/css”); ?>
    in the top of my style.php

    This is what I have in my header.php
    <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” />

    How can I change that
    My style.php is in /themes/limau-orange-01/style.php

    Simply change
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    to
    <link rel="stylesheet" href="https://mydomainname.com/wp-content/themes/limau-orange-01/style.php" type="text/css" media="screen" />

    Thread Starter buckza

    (@buckza)

    thanks
    I did change that but not it looks like the stylesheet is not parsing correct

    This is what I have in style.php

    <?php header(‘Content-type: text/css’); ?>

    /* Setup the Variables */
    $pagewidth = ‘980px’ /* Width of the Page */
    $gutter = ‘5px’ /* Gutter Sise */
    $leftwidth = ‘200px’ /* Left Width */
    $rightwidth = ‘170px’ /* Right Width */

    $fontsizeglobal = ’12px’ /* Global Font Size */
    $fontsizeh1 = ’24px’ /* H1 Font Size */
    $fontsizeh2 = ’16px’ /* H2 Font Size */
    $fontsizeu1 = ’13px’ /* U1 Font Size */

    $fontcolor1 = ‘#666’ /* #666 Grey */
    $fontcolor2 = ‘#000’ /* #000 Black */
    $fontcolor3 = ‘white’ /* #FFF white */

    body {
    font-family:’Verdana’;
    font-size:<? $fontsizeglobal ?>;
    }

    and this is the output I get when I run it in a browser
    /* Setup the Variables */
    $pagewidth = ‘980px’ /* Width of the Page */
    $gutter = ‘5px’ /* Gutter Sise */
    $leftwidth = ‘200px’ /* Left Width */
    $rightwidth = ‘170px’ /* Right Width */

    $fontsizeglobal = ’12px’ /* Global Font Size */
    $fontsizeh1 = ’14px’ /* H1 Font Size */
    $fontsizeh2 = ’16px’ /* H2 Font Size */
    $fontsizeu1 = ’13px’ /* U1 Font Size */

    $fontcolor1 = ‘#666’ /* #666 Grey */
    $fontcolor2 = ‘#000’ /* #000 Black */
    $fontcolor3 = ‘white’ /* #FFF white */

    body {
    font-family:’Verdana’;
    font-size:;
    }

    the fontsize is blank where the code to generate that is
    font-size:<? $fontsizeglobal ?>;

    what am I missing?

    Thread Starter buckza

    (@buckza)

    I found my mistake after browsing the PHP sites
    thanks again – all working now

    kidino

    (@kidino)

    Maybe it should be…

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

    Just wondering…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Dynamic Stylesheet’ is closed to new replies.