Forums

Help me make my site print friendly please! (3 posts)

  1. e5volcano
    Member
    Posted 3 years ago #

    I am a novice to web design and do not know much about html and CSS so I tend to make web pages with the software of wordpress which are content management programs. Anyway, they work fine with the templates they provide except I ran into a problem. I and no one else can print the web pages. I mean they can print it except when they print it out, it looks absolutely garbage. only a few images appear and everything looks messed up.

    My current them for my project is this one for the CMS WordPress, and it still has the error.
    [URL="http://wordpress.org/extend/themes/rusty-grunge"]WordPress › Rusty Grunge WordPress Themes[/URL]
    I have access to edit files, whatever, just tell me how to simply fix it!
    Thanks

    Okay, I researched a bit and some people say it has something to do with the header and its code. I have to do something to where it says "media=screen" and "media=print". But I don't really understand, and can someone just tell me what to put in the code?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>
    [B]
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url') ?>/style.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url') ?>/print.css" media="print"/>
    <link rel="start" href="<?php bloginfo('url') ?>" title="Home" />[/B]
    
    <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'); ?>" />
    <link rel="icon" type="image/x-icon" href="<?php bloginfo('template_url') ?>/favicon.ico" />
    
    <?php wp_head(); ?>
    
    </head>
    <body <?php if (is_home()) { ?>id="home"<?php } else { ?>id="interior" class="<?php echo $post->post_name; ?>"<?php } ?>>
    
      <div id="container">
            <div id="header">
                <h1><a href="<?php bloginfo('url') ?>"><? bloginfo('name'); ?> // <? bloginfo('description'); ?></a></h1>
            </div>
            <div id="header-page"><a href="<?php bloginfo('rss2_url'); ?>"><img alt="RSS Feed" src="http://s.wordpress.org/style/images/feedicon10.png" /></a></div>

    Here is also the print style sheet

    body, #main, #content, #container {
        width: 100%;
        margin: 0;
        float: none;
        background: #fff url(none);
    }
    #header, #sidebar, .ad, .noprint {
        display: none;
    }
    body {
        font: 1em Georgia, "Times New Roman", Times, serif;
        color: #000;
    }
    h1,h2,h3,h4,h5,h6 {
        font-family: Helvetica, Arial, sans-serif;
        color: #000;
    }
    h1 { font-size: 250%; }
    h2 { font-size: 175%; }
    h3 { font-size: 135%; }
    h4 { font-size: 100%; font-variant: small-caps; }
    h5 { font-size: 100%; }
    h6 { font-size: 90%; font-style: italic; }
    
    a:link, a:visited {
        color: #00c;
        font-weight: bold;
        text-decoration: underline; }
    #content a:link:after, #content a:visited:after {
        content: " (" attr(href) ") ";
    }body, #main, #content, #container {
        width: 100%;
        margin: 0;
        float: none;
        background: #fff url(none);
    }
    #header, #sidebar, .ad, .noprint {
        display: none;
    }
    body {
        font: 1em Georgia, "Times New Roman", Times, serif;
        color: #000;
    }
    h1,h2,h3,h4,h5,h6 {
        font-family: Helvetica, Arial, sans-serif;
        color: #000;
    }
    h1 { font-size: 250%; }
    h2 { font-size: 175%; }
    h3 { font-size: 135%; }
    h4 { font-size: 100%; font-variant: small-caps; }
    h5 { font-size: 100%; }
    h6 { font-size: 90%; font-style: italic; }
    
    a:link, a:visited {
        color: #00c;
        font-weight: bold;
        text-decoration: underline; }
    #content a:link:after, #content a:visited:after {
        content: " (" attr(href) ") ";
    }
  2. kaethy
    Member
    Posted 3 years ago #

    'http://lesterchan.net/portfolio/programming/php/#wp-print'

  3. Otto
    Tech Ninja
    Posted 3 years ago #

    Okay, I researched a bit and some people say it has something to do with the header and its code. I have to do something to where it says "media=screen" and "media=print". But I don't really understand, and can someone just tell me what to put in the code?

    Looking at your code, you already have the print stylesheet defined, so really all you have to do is to put that code you have into the print.css file in your theme. Then, when you print the page, what you'll get is a modified version based on that stylesheet.

    I use Firefox and the Web Developer extension to switch between stylesheets so I can easily see the differences. Print Preview will also show you what the result looks like when you print.

    A plugin like wp-print is not required or necessary.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags