WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] sharedaddy doesn't use my css; prints entire page? (4 posts)

  1. jansmith
    Member
    Posted 9 months ago #

    How can I cause sharedaddy to use my css?

    Also, how can I limit what gets printed to just the post content, not the header, footer, sidebar, etc.?

    Thanks,
    jan Smith
    wordblessings.com

    http://wordpress.org/extend/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 9 months ago #

    You can control what gets printed by using the print media query in your theme.

    I see that you've already added some custom styles using that media query in your theme. You can add as many as you want, and the print preview will change accordingly.

    It's worth noting that you should add your media queries to the very end of your stylesheet. This way, the print preview will pick up all your custom styles, plus your print media query modifications.

    I hope this helps.

  3. jansmith
    Member
    Posted 9 months ago #

    Jeremy,

    Thanks for your prompt reply!

    I have put the following at the bottom of my css:

    @media print {
    /* All your print styles go here */
    #header, #footer, #comments, #sidebar, #nav { display: none !important; }
    #content { display:block ;
    margin-left:0;
    float:none;
    width:auto;
    }
    }

    Still, when I use the sharedaddy print button, I get the entire page.

    How does the plugin know to find/use my css?

    Thanks,

    jan

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 9 months ago #

    How does the plugin know to find/use my css?

    Jetpack doesn't actually do anything with your site's CSS: the print button only sends the "print" command to your browser, and your browser then looks for a stylesheet.

    Could you try replacing #menu by .menu, since that container uses a class, and not an ID? You might also want to add #hellobar-banner, #hdr_img_container_other p to the list of elements to hide.

    I hope this helps.

Reply

You must log in to post.

About this Plugin

About this Topic