Title: Random CSS
Last modified: August 19, 2016

---

# Random CSS

 *  [Dennis](https://wordpress.org/support/users/altermann/)
 * (@altermann)
 * [16 years ago](https://wordpress.org/support/topic/random-css/)
 * 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?

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years ago](https://wordpress.org/support/topic/random-css/#post-1485981)
 * 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](http://codex.wordpress.org/Template_Tags/bloginfo)

Viewing 1 replies (of 1 total)

The topic ‘Random CSS’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [header](https://wordpress.org/support/topic-tag/header/)

 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/random-css/#post-1485981)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
