• I created a print stylesheet, and it is mostly, but I wanted to have the header image appear on the printed page, and I thought that I had suppressed the sidebar from printing but I guess not. Can someone kindly tell me how to make these changes?
    Thanks.

    Here is the stylesheet code:

    /* Print Style Sheet */
    @media print {
    body { background:white; color:black; margin:0 }
    }
    #header { height:75px;
         font-size: 24pt;
         color:black }
    #content { margin-left:0;
         float:none;
         width:auto;
         color:black;
         font-size:12pt }
    #comments {display:none  }
    #sidebar { display:none }
    #content{ margin-left:0;
         float:none;
         width:auto }
    #footer { }
    
    h1, h2, h3, h4, h5, h6 { page-break-after:avoid;
         page-break-inside:avoid }
    img { page-break-inside:avoid;
         page-break-after:avoid; }
    blockquote, table, pre { page-break-inside:avoid }
    ul, ol, dl  { page-break-before:avoid }
    }
    
    <?php get_header(); ?>
    
    <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?>
    
    <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
    <?php the_content('(continue reading...)'); ?>
    
    <?php endwhile; ?>
    
    <?php else : ?>
    
    <a href="<?php the_permalink() ?>">Not Found</a>
    Sorry, but you are looking for something that isn't here. You can search again by using <a href="#searchform">this form</a>...
    
    <?php endif; ?>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
Viewing 8 replies - 1 through 8 (of 8 total)
  • if the header image is a background graphic, it won’t print.

    although in some browsers, the user can set the background images to print, but you cannot influence that.

    is your sidebar’s div really ‘#sidebar’ ?

    why is php code in your print style sheet?

    Site url?

    Thread Starter luceylin

    (@luceylin)

    I have no idea why php is in my style sheet. I basically copied it from somewhere and amended it. Site URL is paullucey.com

    Thread Starter luceylin

    (@luceylin)

    The header is a foreground graphic I think. I built the site in Artisteer, and put the header image in foreground as opposed to background. Not sure if this helps.

    your sidebar is class .art-sidebar1

    you can add the header image to the html in header.php:
    <div class="art-Header-jpeg"><img src="https://www.paullucey.com/wp-content/themes/PRLfinal/images/Header.jpg" /></div>

    it will then print with the page.

    and delete all the php stuff from the print style.

    good luck ??

    Your print.css sheet isn’t being loaded in header.php. Assuming that print.css is in your theme’s folder, you need to edit header.php and change:

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen, print" />

    to

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/print.css" media="print" />

    Then edit print.css and delete everything from <?php get_header(); ?> down to the bottom of the file.

    Thread Starter luceylin

    (@luceylin)

    Esmi
    Changing the text as you suggested did not fix it. Now the menus are printing down the page as text????? The print.cc is in the theme folder. When you say edit print.css, did you mean just to delete the stuff you said, or was I to make another change as well?

    Just delete stuff.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Adding header image to printed page’ is closed to new replies.