Give help. Get help.

  • # December 22, 2012 at 8:41 am

    I am running a wordpress site [here]( and im trying to run php in the style.css with .htaccess but its not working.

    # December 22, 2012 at 8:45 am

    Working link:

    # December 22, 2012 at 9:04 am

    @htmlmainiac Can we see your style.css file?

    Edit: Oops. I meant your .htaccess file.

    It seems it’s working since I see styling on your site. What’s not working for you?

    # December 22, 2012 at 9:20 am

    Try adding this piece of code in place of yours at the top of your style.css file.

    < ?php
    header(“Content-type: text/css; charset: UTF-8”);

    $noUnderline = “none”;

    And then right outside the closing PHP tag (?>), place this:

    a {text-decoration: < ?php echo $noUnderline; ?>;}

    # December 23, 2012 at 1:38 pm

    I don’t see any PHP. PHP shouldn’t output as PHP unless there’s an error in your code. Is the htaccess file in the same place as your style.css?

    # December 23, 2012 at 2:05 pm

    I’ve found a couple ways to do this. You can either tell your server to rewrite a *.css request to look at a PHP script (such as “style.php?name=style”). The other way you can do this is by configuring .css files to be handled by php. I think this .htaccess code should work:

    php_value default_mimetype "text/css"

    Make sure this .htaccess is at least in the same directory as your css php script.

    # December 24, 2012 at 8:14 am

    @Htmlmainiac Can you at least answer our questions while ignoring some of our solutions?

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.