• Resolved rarerborealis

    (@rarerborealis)


    Hi there,

    I’m setting up a website at https://www.yrfriendmatthew.com and wanted a rotating header image. I downloaded the following php:

    AUTOMATIC IMAGE ROTATOR
    Version 2.2 – December 4, 2003
    Copyright (c) 2002-2003 Dan P. Benjamin, Automatic, Ltd.
    All Rights Reserved.

    https://www.hiveware.com/imagerotator.php

    https://www.automaticlabs.com/

    and created a folder called ‘rotator’ in my image folder containing two sample headers and the ‘rotate.php’. I’m running into a problem implementing it. I’ve tried the following:

    -putting img src="/images/rotator/rotate.php"/ under #header and #headerimg in the style.css

    -putting a link as above next to ‘$img=’ under the header-img.php (since deleted in an attempt to see if it was overriding anything; please let me know if perhaps I should put it back)

    -Putting a link to the above under the header.php, changing

    `#page { background: url(“<?php bloginfo(‘stylesheet_directory’); ?>/images/kubrickbg-<?php bloginfo(‘text_direction’); ?>.jpg”) repeat-y top; border: none; }
    <?php } else { // No sidebar ?>
    #page { background: url(“<?php bloginfo(‘stylesheet_directory’); ?>/images/kubrickbgwide.jpg”) repeat-y top; border: none; }
    <?php } ?>`

    to

    `#page { background: url(“<?php bloginfo(‘stylesheet_directory’); ?>/images/rotator/rotate-<?php bloginfo(‘text_direction’); ?>.php”) repeat-y top; border: none; }
    <?php } else { // No sidebar ?>
    #page { background: url(“<?php bloginfo(‘stylesheet_directory’); ?>/images/rotator/rotate.php”) repeat-y top; border: none; }
    <?php } ?>`

    Editing code isn’t a strength of mine but I can troubleshoot fairly easily and follow more technical information. Any help would be greatly appreciated.

Viewing 12 replies - 1 through 12 (of 12 total)
  • esmi

    (@esmi)

    2003? That’s pretty old code! You should be able to display a rotating header image using CSS mixed with a little PHP. Try downloading the Seasons theme which the CSS/PHP approach to change the complete color theme based on the current month. The file you might want to have a look at is seasons-css.php. Might give you some ideas…

    Thread Starter rarerborealis

    (@rarerborealis)

    I took a look at the Seasons theme and the seasons-css.php; though lovely I’m not sure I need something extensive as a .css. While changing the whole page’s look is neat, I just want the header image to change with each page refreshment. I’m pretty sure I could get away with just a php coding, but my problem is I’m not sure in Kubric how or where to install something like that.

    Indeed, the rotator.php is pretty old, but I liked what it claimed as functionality- I could have a folder with the various images and not have to separately code each one; the php would rotate them automatically by virtue of being in the shared folder. Is there anything similar around today?

    esmi

    (@esmi)

    Thread Starter rarerborealis

    (@rarerborealis)

    I’ll give these two a try and see if they work. Thanks!

    Thread Starter rarerborealis

    (@rarerborealis)

    Ok, I successfully loaded the wordpress dynamic-headers plug in and it’s properly installed; I pasted the code into my header.php and just deleted the header-image.php as I’d already blocked out nearly everything on it, and yet, the image still doesn’t show up! I am suspecting my background is somehow going up to the top of the page and blocking it. Is that even possible?

    Thread Starter rarerborealis

    (@rarerborealis)

    HOORAY! I got the dynamic image generator to work at the top of my page. However now there’s another bit of weirdness- it looks like there’s an invisible header between the dynamic header and the posts. Do I need to remove some code? Also for anyone else using the dynamic image header in Kubrick, I put my code here in the header.php”

    <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    
    <?php wp_head(); ?>
    </head>
    <body <?php body_class(); ?>>
    <div id="page">
    
    <?php show_media_header(); ?>
    
    <div id="header" role="banner">
    	<div id="headerimg">
    		<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
    		<div class="description"><?php bloginfo('description'); ?></div>
    	</div>
    </div>
    <hr />
    esmi

    (@esmi)

    It’s your old header. Since you’re not using it for anything now, try adding display:none; to:

    #header {
    height:200px;
    margin:0 0 0 1px;
    padding:0;
    width:758px;
    }

    in style.css

    Thread Starter rarerborealis

    (@rarerborealis)

    Radical! Worked like a charm! Many thanks.

    Thread Starter rarerborealis

    (@rarerborealis)

    Just a quick update to anyone else using the dynamic image generator- here’s where you put the code so you don’t have to ‘delete’ your old header; it goes at the bottom of the php:

    <div id="header" role="banner">
    	<div id="headerimg">
    <?php show_media_header(); ?>
    		<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
    		<div class="description"><?php bloginfo('description'); ?></div>
    
    	</div>
    </div>
    <hr />

    rareborealis:

    Thanks for posting that. I’ve got the plugin working fine except when I refresh to show a new random header I see the default Kubrick BLUE BLOB for a second or two as the image changing/rotates. I know it’s the default theme but I’ve been unable to figure out where to code so as to make that blue blob stop “dripping” on the page between image changes.

    I’ve tried putting display:none in various parts of the Kubrick CSS file AND in the header.php file(commenting things out, etc.) and nothing prevents the blue blob from showing in-between refreshes, albeit briefly. It’s driving me nuts. I’ve also tried putting in #fff (white) and nothing will stop the blue blob!

    Ideas? Anyone? Probably something simple but I just can’t seem to figure it out.

    Thanks for any help!

    assuming that the blue blob comes from ‘kubrickheader.jpg’, use a graphic editor and edit it into a color you can live with.

    Yeah I could do that. Just thought there might be a more graceful (code) way to handle it (display:none;).

    Update: I did that (changed image to all white leaving borders and shading, etc.) and it’s better (not showing the blob on EVERY rotation) but I still see it once in a while, which means it’s getting the color from somewhere else, I think, too.

    Update to the update: Found a place where the Kubrick default blue was still in place: Appearance — Custom Header — Advanced —
    Changed default colors (“upper” color and “lower” color) to #ffffff. All better now. Leaving this here in case anyone else comes along someday wondering WTH to try.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Adding Kubrick Rotating Header Image php’ is closed to new replies.