Howto: Create a random header (function and CSS) (1 post)

  1. t31os
    Posted 7 years ago #

    I'm not sure if many people followed my last post, with a basic function for switching a single image using a theme function.

    Well i've had a little time to learn a bit more PHP and re-write some pieces of code, to come up with a function that's easy to use and will randomise a CSS class or ID.


    It's free code, written by me, no credits, no fee, no restrictions or links.

    My blogging skills leave a bit to be desired but i'm sure once you get past that you'll find the above function of use...

    Function:: wp_rand_css
    Arguments:: $csstype, $cssname, $cssprefix, $cssrandnum
    Output:: Random class="CHOOSENVALUE_X" or ID="CHOOSENVALUE_X"

    Function already echoes the value, so usage is like so...

    <div id="myelement" <?php wp_rand_css();?>>

    Post linked above has live examples...

    Very interested to hear comments or suggestions.. :-)

Topic Closed

This topic has been closed to new replies.

About this Topic