Support » Themes and Templates » Howto: Create a random header (function and CSS)

  • 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.. 🙂

  • The topic ‘Howto: Create a random header (function and CSS)’ is closed to new replies.