Title: random header in header.php
Last modified: August 18, 2016

---

# random header in header.php

 *  [foxmulder87](https://wordpress.org/support/users/foxmulder87/)
 * (@foxmulder87)
 * [18 years, 8 months ago](https://wordpress.org/support/topic/random-header-in-headerphp/)
 * hey guys,
 * my header.php atm looks like that:
 * [php]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt);
   
   <html xmlns=”[http://www.w3.org/1999/xhtml”&gt](http://www.w3.org/1999/xhtml”&gt);
   <head profile=”[http://gmpg.org/xfn/11″&gt](http://gmpg.org/xfn/11″&gt);
 *  <title><?php bloginfo(‘name’); ?><?php wp_title(); ?></title>
 *  <meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset
   =<?php bloginfo(‘charset’); ?>” />
    <meta name=”generator” content=”WordPress
   <?php bloginfo(‘version’); ?>” /> <!– leave this for stats please –>
 *  <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/
   css” media=”screen” />
    <link rel=”alternate” type=”application/rss+xml” title
   =”RSS 2.0″ href=”<?php bloginfo(‘rss2_url’); ?>” /> <link rel=”alternate” type
   =”text/xml” title=”RSS .92″ href=”<?php bloginfo(‘rss_url’); ?>” /> <link rel
   =”alternate” type=”application/atom+xml” title=”Atom 0.3″ href=”<?php bloginfo(‘
   atom_url’); ?>” /> <link rel=”pingback” href=”<?php bloginfo(‘pingback_url’);?
   >” />
 *  <?php wp_get_archives(‘type=monthly&format=link’); ?>
    <?php //comments_popup_script();//
   off by default ?> <?php wp_head(); ?> </head> <body> <div id=”container”>
 *  <div id=”header”>
    <h1>” title=”<?php bloginfo(‘name’); ?>”><?php bloginfo(‘
   name’); ?>
   </h1>
    <div id=”menu”>
    - 
 *  </div>
    </div>
 *  <div id=”pagewrapper”><div id=”page”>
 * <div id=”banner”> </div>[/php]
 * But now i wan’t to insert the following lines into my header.php so that i have
   rotating header pictures:
 * [php]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt);
   
   <html xmlns=”[http://www.w3.org/1999/xhtml”&gt](http://www.w3.org/1999/xhtml”&gt);
 * <head profile=”[http://gmpg.org/xfn/11″&gt](http://gmpg.org/xfn/11″&gt);
    <meta
   http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?
   php bloginfo(‘charset’); ?>” />
 *  <title><?php if (is_single() || is_page() || is_archive()) { wp_title(”,true);}
   else { bloginfo(‘name’); echo(‘ — ‘); bloginfo(‘description’); } ?></title>
 *  <meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” /> 
   <!– leave this for stats –>
 *  <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/
   css” media=”screen” />
    <!–[if lte IE 7]> <link rel=”stylesheet” type=”text/css”
   href=”<?php bloginfo(‘template_url’); ?>/ie7.css” /> <![endif]–> <!–[if lte IE
   6]> <link rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘template_url’);?
   >/ie6.css” /> <![endif]–> <link rel=”alternate” type=”application/rss+xml” title
   =”<?php bloginfo(‘name’); ?> RSS Feed” href=”<?php bloginfo(‘rss2_url’); ?>” /
   > <link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />
 *  <?php wp_head(); ?>
    </head> <body>
 * <div id=”container”>
 *  <div id=”masthead”>
    <h1>“><?php bloginfo(‘name’); ?>
   </h1>
    <h3><?php bloginfo(‘
   description’); ?></h3> </div>
 *  <ul id=”nav”>
    - 
    - 
    - 
    - 
    -  <div id=”header_img”>
       <img src=”<?php bloginfo(‘template_url’); ?>/images/
      header_<?php echo(rand(1,5)); ?>.jpg” width=”770″ height=”140″ alt=”<?php 
      bloginfo(‘name’); ?> random header image” title=”<?php bloginfo(‘name’); ?
      > random header image” /> </div>[/php]
    - Now the problem is that I don’t know where exactly i have to insert the data
      so that it doens’t change the current layout. I’d be very thankful for some
      help. 🙂
    - greetz,
       fox

The topic ‘random header in header.php’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [foxmulder87](https://wordpress.org/support/users/foxmulder87/)
 * Last activity: [18 years, 8 months ago](https://wordpress.org/support/topic/random-header-in-headerphp/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
