m7abib
asked 11 years ago

When I click the print link at the article page it just shows up a blank page to be printed. any ideas on this?

5 Answers
m7abib
answered 11 years ago

Oh, I’m talking about the DW Focus theme.

ElleryG
answered 11 years ago

Yes, and the email button doesn’t work either.

DominicStaff
answered 11 years ago

Hi !

-can you send links site of you all. I can check and fix for you.

Regards,

Dominic

ElleryG
answered 11 years ago

I think you have my info already…thanks!

Lucas
answered 11 years ago

the print option when using my iPhone 5 opens a new page that is blank rather than opening a new email.   the print button in Firefox also opens outlook and has the title of the article as the email subject. However it does not have a link or anything from the article in the subject area.

DominicStaff
answered 11 years ago

Hi !
Please go to line 430 of <dw-focus>/functions.php and replace below line:
        <li><i></i><a href=”javascript:window.print()” ><?php _e(‘Print this article’,’dw_focus’); ?></a></li>
by
        <li><i></i><a href=”#” onclick=”window.print();”><?php _e(‘Print this article’,’dw_focus’); ?></a></li>
 
If you want to print only content of this post please follow my guide bellow:

1, Create print.css file in <dw-focus>/assets/css/print.css  with content:

body{
visibility: hidden;
}
body .content-print {
visibility: visible;
}
 
body .content-print .entry-action{
visibility: hidden;
}

2, Go to <dw-focus>/functions.php add this code

/**
 * PRINT SETUP
 */
function dw_print_enqueue_style(){
    if( is_single() ){
        wp_enqueue_style( ‘print-style’, get_template_directory_uri() . ‘/assets/css/print.css’, array(), false, $media = ‘print’ );
    }
}
add_action( ‘wp_enqueue_scripts’, ‘dw_print_enqueue_style’ );


function dw_add_class_for_print($classes) {
    global $post;
    $classes[] = ‘content-print’;
    return $classes;
}
add_filter(‘post_class’, ‘dw_add_class_for_print’);

Regards,
Dominic

ElleryG
answered 11 years ago

Very nice, Dominic. It worked first try. Thank you! Maybe I will even try fixing the email link too now that I know where it is!

Lucas
replied 11 years ago

Let me know what you do if you fix it Ellery!

ElleryG
replied 11 years ago

Oh, you bet!

Powered by DW Question & Answer Pro