WordPress.org

Forums

Random CSS (2 posts)

  1. Dennis
    Member
    Posted 5 years ago #

    Hello,

    I want to use random CSS, tried it:

    <?php
    $css = rand(1,5);
    echo "<link rel='stylesheet' href='".$css.".css' type='text/css'>";
    ?>

    at header.php, but only work in main page, anyone know y?

  2. alchymyth
    Forum Moderator
    Posted 5 years ago #

    maybe you could try to use the absolute path to the css file by integrating 'bloginfo('template_url')' or the corresponding bloginfo() to the location of your css files.

    http://codex.wordpress.org/Template_Tags/bloginfo

Topic Closed

This topic has been closed to new replies.

About this Topic