• I would like to be able to rotate the kubrickheader from a bank of photographs with each refresh. This is outside the relm of WordPress program, it would have to be an add on or plug-in. Any ideas on how to go about this?

    Sounds like a neat idea for https://metaltiger.org

    Thanks for the suggestions.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Uhh, I think Matt’s Random Image Script is more what MetalTiger had in mind.

    I just did it. See it at https://www.mcdevzone.com/

    I have a series of images kubrickheader0.jpg – kubrickheader7.jpg in my images directory and I added the following script to header.php:

    <?php
    function header_graphic() {
    echo “/images/”;
    $num=rand(0,7);
    echo “kubrickheader”.$num.”.jpg”;
    };
    ?>

    Finally, I changed the stylesheet header element as follows:

    #header { background: url(“<?php bloginfo(‘stylesheet_directory’); header_graphic(); ?>”) no-repeat bottom center; }

    Mike, your solution looks easy. Famous last words… ??

    Clearly, I’m doing something wrong. I cut and past the php function and put it at the very top of my header.php file (the one in the themes/default directory).

    I then replaced the uncommented line that starts with #header in the same header.php file with the header element shown.

    I placed 9 images named kubrickheader0.jpg through kubrickheader9.jpg in the themes/default/images directory.

    Now, my header is just a blue box and the footer is a gray box. I didn’t think I did anything to the footer.

    What did I do wrong?

    https://blogan.net

    Thread Starter metaltiger

    (@metaltiger)

    Thank you all so much. This gives me something to work on. Thank you again.

    Thank you, Mike! With your help, I was able to get it working. Turns out, I was putting the php function at the very top of the header.php file, when it should go after the DOCTYPE and html lines and before the head line.

    I documented it in more detail in this article.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Header Automatic Change’ is closed to new replies.