WordPress.org

Forums

Change Header image (6 posts)

  1. ScottKR
    Member
    Posted 1 year ago #

    There are two separate pages. These two pages have the same header graphic.
    Both will be replaced with a new image.
    I found this in the header.php file

    default:
    echo 'slides2[0] = ["';
    bloginfo('template_directory');
    echo '/images/image4.jpg", ""];';

    image4.jpg is being used for both page headers but this won't be the case as each page will now need to have its own header image. I really have no idea what I need to do to make this happen.

    I'll be making two new images to be named "sm.png" and "dyw.png".

    sm.png will replace image4.jpg Can I just upload sm.png to the images directory and change the above code to this?

    default:
    echo 'slides2[0] = ["';
    bloginfo('template_directory');
    echo '/images/sm.png", ""];';

    Then what about the other page that will need the header dyw.png How do I make that happen?

  2. the posted code section is not sufficient to check how your theme is organized.

    what theme are you using?

    have you checked http://codex.wordpress.org/Conditional_Tags

    for instance is_page()

  3. ScottKR
    Member
    Posted 1 year ago #

    Thanks for replying. The site was done by some other firm. I just took over the hosting. I just logged into the Admin and that firm that did the site created their own theme. I looked at the site you sent here but I'm not a programmer so I don't understand it. Is there anything else I can send or give you for you to help me figure out what I need to do to make these changes?

  4. but I'm not a programmer so I don't understand it

    in this case, consider to post a job at http://jobs.wordpress.net/

    helping with custom made themes is very difficult in the forum as the template codes are not freely accessible.

    however, you could try posting the full code of header.php to see if that enables somebody to help.
    http://codex.wordpress.org/Forum_Welcome#Posting_Code

  5. ScottKR
    Member
    Posted 1 year ago #

    Ok thanks.

  6. ScottKR
    Member
    Posted 1 year ago #

    There are two separate pages. These two pages have the same header graphic.
    Both will be replaced with a new image.

    image4.jpg is being used for both page headers but this won't be the case as each page will now need to have its own header image. I really have no idea what I need to do to make this happen.

    I'll be making two new images to be named "sm.png" and "dyw.png".

    sm.png will replace image4.jpg Can I just upload sm.png to the images directory and change the above code to this?
    echo '/images/sm.png", ""];';

    Then what about the other page that will need the header dyw.png How do I make that happen?

    This is the header.php code.

    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    
    <head>
    	<meta charset="<?php bloginfo('charset'); ?>" />
    
    	<?php if (is_search()) { ?>
    	   <meta name="robots" content="noindex, nofollow" />
    	<?php } ?>
    
    	<title>
    		   <?php
    		      if (function_exists('is_tag') && is_tag()) {
    		         single_tag_title("Tag Archive for &quot;"); echo '&quot; - '; }
    		      elseif (is_archive()) {
    		         wp_title(''); echo ' Archive - '; }
    		      elseif (is_search()) {
    		         echo 'Search for &quot;'.wp_specialchars($s).'&quot; - '; }
    		      elseif (!(is_404()) && (is_single()) || (is_page())) {
    		         wp_title(''); echo ' - '; }
    		      elseif (is_404()) {
    		         echo 'Not Found - '; }
    
    		   ?>
    	</title>
    
    	<link rel="shortcut icon" href="/favicon.ico">
    
    	<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
    
    	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
    
    	<?php if ( is_singular() ) wp_enqueue_script('comment-reply'); ?>
    
    <script type="text/javascript">
    //If using image buttons as controls, Set image buttons' image preload here true
    //(use false for no preloading and for when using no image buttons as controls):
    var preload_ctrl_images=false;
    var slides2=[]; //SECOND SLIDESHOW
    //configure the below images and descriptions to your own.
    <?php
    switch(get_queried_object_id()){
    case 14:
    	echo 'slides2[0] = ["';
    	bloginfo('template_directory');
    	echo '/images/banner-wtf.png", ""];';
    break;
    case 12:
    	echo 'slides2[0] = ["';
    	bloginfo('template_directory');
    	echo '/images/banner-wwtf.png", ""];';
    break;
    case 10:
    	echo 'slides2[0] = ["';
    	bloginfo('template_directory');
    	echo '/images/banner-wwtf2.png", ""];';
    break;
    case 8:
    	echo 'slides2[0] = ["';
    	bloginfo('template_directory');
    	echo '/images/banner-cwusr.png", ""];';
    break;
    case 6:
    	echo 'slides2[0] = ["';
    	bloginfo('template_directory');
    	echo '/images/banner-wtpusr.png", ""];';
    break;
    default:
    	echo 'slides2[0] = ["';
    	bloginfo('template_directory');
    	echo '/images/image4.jpg", ""];';
    break;
    }
    ?>
    //optional properties for these images:
    slides2.no_descriptions=1;
    slides2.no_controls=1;
    slides2.delay=6000;
    slides2.random=1;
    
    </script>
    <script src="<?php bloginfo('template_directory'); ?>/js/swissarmy.js" type="text/javascript">
    /***********************************************
    * Swiss Army Image slide show script  - © John Davenport Scheuer: http://home.comcast.net/~jscheuer1/
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full original source code
    ***********************************************/
    </script>
    
    	<?php wp_head(); ?>
    
    </head>
    
    <body <?php body_class(); ?>>
    
    	<div id="wrapper">
    	<div id="container">
    		<div id="header">
    
    		<div id="logo"><a href="<?php echo get_permalink('16'); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/logo.png" /></a></div>
    
    		<div id="phone"><a href="tel:+18004472366"><img src="<?php bloginfo('template_directory'); ?>/images/phone.png" /></a></div>
    
    		</div>
    
    		<div id="navbar">	
    
    		<ul>
    
    		 	 <?php wp_nav_menu(array('menu' => 'Main Navigation Menu')); ?>
    
    		</ul>
    
    		</div>
    
    		<table border="0" cellspacing="10" width="1024">
    
    			<tr>
    
    				<td valign="top" width="717">
    
    					<div id="flash">
    						<script type="text/javascript">
    							new inter_slide(slides2);
    						</script>
    					</div>

Topic Closed

This topic has been closed to new replies.

About this Topic