WordPress.org

Forums

Header image/flash (1 post)

  1. DmitrijsPelihs
    Member
    Posted 1 year ago #

    The site i`am working know is http://www.thpb.lv
    My theme: Twentyeleven
    My goal: In the header i need on every page appear on random images or flash movies with links to posts and on some posts display featured image.

    So Twentyelen header functionality fit but doesn't support flash.

    Now iam using this code from this forum:https://forums.digitalpoint.com/threads/script-for-random-image-or-flash-file.36767/page-2

    $imageorflash = rand(1,2);
    	If ($imageorflash == 1){
    		$random_number = rand(0,1);
    		echo '<div id="header-img"><object width="980" height="258">
    		<param name="movie" value="flash' . $random_number . '.swf">
    		<embed src="' . get_stylesheet_directory_uri() . '/images/header-img/flash' . $random_number . '.swf" width="980" height="258">
    		</embed>
    		</object></div>';
    		}
    	else {
    		$random_integer = rand(0,4); // Assumes you have images from image0 to image4
    		echo '<div id="header-img"><img src="' . get_stylesheet_directory_uri() . '/images/header-img/image', $random_integer, '.jpg"></img></div>'; //point to the correct domain/folder, this assumes .jpg but can be easily changed
    		}

    at least flash works.

    So can anyone help me to solve this riddle

    Thank you

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.