WordPress.org

Ready to get started?Download WordPress

Forums

Print Friendly and PDF Button
[resolved] Print-page showing only right sidebar (4 posts)

  1. capescafe
    Member
    Posted 1 year ago #

    I'm using the shortcode on my page to add the Print button. The section I want to print is just coupon images but for some reason when I click on the print button all that shows in the print-friendly screen is my right sidebar content, none of the images. I've tried adding the print-only class to my div as well as my images but it still only shows the right sidebar content. When I added the class print-no to my right side-bar content, then the whole web page shows up in the print-friendly window. How can I get only my coupon images to print. Here's the page in question: http://carpet-cleaning-wa.com/mobile/?page_id=69

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

  2. jrf
    Member
    Plugin Contributor

    Posted 1 year ago #

    Hiya,

    Had a quick look at the code, and at first look, this might be a templating issue. Your page template indicates that the sidebar is part of the post, which could well be the reason why this happens. Not 100% sure though, that part of the plugin is not my field.

    To explain what I mean, here's some sample HTML [NOTE: not real code, do not use in a site!].

    Example of clean template code:

    <div class="content-wrapper container main">
    	<div id="post">
    		Content
    	</div>
    	<div id="sidebar">
    		Sidebar
    	</div>
    </div>

    What I found on your site:

    <div class="content-wrapper container main">
    	<div id="post-69">
    		<div class="page-wrapper single-page single-sidebar right-sidebar">
    			<div class="row gdl-page-row-wrapper">
    				Content
    				<div class='sidebar'>
    				etc...

    Could you try adding print-only class only to the coupon, like you have:

    <div class="print-only coupons">

    And removing it from the images itself ?

    And may be try adding the print-no class to the sidebar here:

    <div class="sidebar-wrapper print-no">

    or is that what you already tried ?

    Hope this helps.

    Smile,
    Juliette

  3. capescafe
    Member
    Posted 1 year ago #

    Yeah that's exactly what I did. I already have the
    <div class="print-only coupons">

    But as soon as I add the print-no class like you mentioned above the whole page duplicates in the print window. Sidebar, images, header, everything. I'm using a theme, so the structure of the code is based on how the theme is set up. So not sure why this is not working. It's weird that it's only seeing the info in my sidebar.

  4. printfriendly
    Member
    Plugin Author

    Posted 1 year ago #

    To fix, add class="print-only" to the parent element.

    <div class="row print-only"><div class="twelve columns "><h2>Specials</h2>
    <div class="coupons">
    <img src="http://carpet-cleaning-wa.com/mobile/wp-content/uploads/2013/03/carpetcleanad.jpg" alt="10% Off Carpet Cleaning Coupon" width="400" height="134" class="alignnone size-full wp-image-74">...

    The reason it's not working on <div class="coupons"... is a bug in our print-only rule which we are fixing. We appreciate you bringing this to our attention and your patience.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic