WP-Print - Version 2.56

Version Description

Download this release

Release Info

Developer GamerZ
Plugin Icon WP-Print
Version 2.56
Comparing to
See all releases

Code changes from version 2.55 to 2.56

Files changed (4) hide show
  1. print-css.css +49 -39
  2. print-posts.php +107 -25
  3. readme.txt +8 -7
  4. wp-print.php +2 -2
print-css.css CHANGED
@@ -1,65 +1,75 @@
1
- BODY {
2
  font-family: Verdana, Arial, Tahoma;
3
- font-size: 12px;
4
  color: #000000;
5
  }
6
- IMG {
7
- max-width: 100%;
 
 
8
  }
9
- P {
10
- word-wrap: break-word;
 
 
 
11
  }
12
- .Center {
13
- margin: 0px auto 0px auto;
 
 
 
 
 
14
  }
15
- #Outline {
16
- width: 90%;
17
- margin-left: auto;
18
- margin-right: auto;
19
- padding: 10px;
20
- border: 1px solid #000000;
21
  }
22
- #BlogTitle {
 
23
  font-weight: bold;
24
- font-size: 16px;
25
  margin-bottom: 5px;
26
  }
27
- #BlogDate {
28
- margin-top: 5px;
29
- margin-bottom: 10px;
 
 
 
30
  }
31
- #BlogContent {
32
- padding: 10px;
33
- margin-top: 10px;
 
 
 
34
  }
35
- HR.Divider {
36
- width: 80%;
37
- height: 1px;
38
- color: #000000;
39
- }
40
- #CommentTitle {
41
- font-weight: bold;
42
- font-size: 16px;
43
- padding-bottom: 10px;
44
- }
45
- .CommentDate {
46
- margin-top: 5px;
47
- margin-bottom: 10px;
48
  }
49
- .CommentContent {
50
- padding: 2px 10px 10px 10px;
 
 
 
 
51
  }
 
52
  @media print {
53
  #comments_controls,
54
  #print-link {
55
  display: none;
56
  }
57
  }
58
- .alignleft, div.alignleft {
59
  float: left;
60
  margin: 10px 10px 5px 0;
61
  }
62
- .alignright, div.alignright {
63
  float: right;
64
  margin: 10px 0 5px 10px;
65
  }
1
+ body {
2
  font-family: Verdana, Arial, Tahoma;
3
+ font-size: 14px;
4
  color: #000000;
5
  }
6
+ * {
7
+ padding: 0;
8
+ margin: 0;
9
+ list-style-type: none;
10
  }
11
+ hr { display: none; }
12
+ img { max-width: 100%; }
13
+ p {
14
+ word-wrap: break-word;
15
+ margin-bottom: 15px;
16
  }
17
+ a { color: inherit; }
18
+
19
+ /* Header */
20
+ .entry-header {
21
+ margin-bottom: 25px;
22
+ padding-bottom: 25px;
23
+ border-bottom: 1px solid #555;
24
  }
25
+ .hat {
26
+ display: block;
27
+ text-align: center;
28
+ margin: 15px 0 20px 0;
 
 
29
  }
30
+
31
+ .entry-title, #CommentTitle {
32
  font-weight: bold;
33
+ font-size: 21px;
34
  margin-bottom: 5px;
35
  }
36
+ #CommentTitle { margin-bottom: 15px; }
37
+
38
+ /* Main */
39
+ .center {
40
+ margin: 0 auto;
41
+ padding: 0 2%;
42
  }
43
+
44
+
45
+ /* content */
46
+ .entry-content {
47
+ margin-bottom: 35px;
48
+ line-height: 170%;
49
  }
50
+
51
+ pre {
52
+ white-space: pre-wrap;
 
 
 
 
 
 
 
 
 
 
53
  }
54
+
55
+ /* Footer */
56
+ .footer {
57
+ margin-top: 25px;
58
+ padding: 25px 0 0 0;
59
+ border-top: 1px solid #555;
60
  }
61
+
62
  @media print {
63
  #comments_controls,
64
  #print-link {
65
  display: none;
66
  }
67
  }
68
+ .alignleft, .alignleft {
69
  float: left;
70
  margin: 10px 10px 5px 0;
71
  }
72
+ .alignright, .alignright {
73
  float: right;
74
  margin: 10px 0 5px 10px;
75
  }
print-posts.php CHANGED
@@ -14,8 +14,8 @@
14
 
15
  global $text_direction;
16
  ?>
17
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
18
- <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
19
  <head>
20
  <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>
21
  <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
@@ -35,30 +35,112 @@ global $text_direction;
35
  <link rel="canonical" href="<?php the_permalink(); ?>" />
36
  </head>
37
  <body>
38
- <p style="text-align: center;"><strong>- <?php bloginfo('name'); ?> - <span dir="ltr"><?php bloginfo('url')?></span> -</strong></p>
39
- <div class="Center">
40
- <div id="Outline">
41
- <?php if (have_posts()): ?>
 
 
 
 
 
 
 
 
 
 
 
 
42
  <?php while (have_posts()): the_post(); ?>
43
- <p id="BlogTitle"><?php the_title(); ?></p>
44
- <p id="BlogDate"><?php _e('Posted By', 'wp-print'); ?> <u><?php the_author(); ?></u> <?php _e('On', 'wp-print'); ?> <?php the_time(sprintf(__('%s @ %s', 'wp-print'), get_option('date_format'), get_option('time_format'))); ?> <?php _e('In', 'wp-print'); ?> <?php print_categories('<u>', '</u>'); ?> | <u><a href='#comments_controls'><?php print_comments_number(); ?></a></u></p>
45
- <div id="BlogContent"><?php print_content(); ?></div>
46
- <?php endwhile; ?>
47
- <hr class="Divider" style="text-align: center;" />
48
- <?php if(print_can('comments')): ?>
49
- <?php comments_template(); ?>
50
- <?php endif; ?>
51
- <p><?php _e('Article printed from', 'wp-print'); ?> <?php bloginfo('name'); ?>: <strong dir="ltr"><?php bloginfo('url'); ?></strong></p>
52
- <p><?php _e('URL to article', 'wp-print'); ?>: <strong dir="ltr"><?php the_permalink(); ?></strong></p>
53
- <?php if(print_can('links')): ?>
54
- <p><?php print_links(); ?></p>
55
- <?php endif; ?>
56
- <p style="text-align: <?php echo ('rtl' == $text_direction) ? 'left' : 'right'; ?>;" id="print-link"><?php _e('Click', 'wp-print'); ?> <a href="#Print" onclick="window.print(); return false;" title="<?php _e('Click here to print.', 'wp-print'); ?>"><?php _e('here', 'wp-print'); ?></a> <?php _e('to print.', 'wp-print'); ?></p>
57
- <?php else: ?>
58
- <p><?php _e('No posts matched your criteria.', 'wp-print'); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  <?php endif; ?>
60
  </div>
61
- </div>
62
- <p style="text-align: center;"><?php echo stripslashes($print_options['disclaimer']); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  </body>
64
- </html>
14
 
15
  global $text_direction;
16
  ?>
17
+ <!DOCTYPE html>
18
+ <html lang="en">
19
  <head>
20
  <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>
21
  <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
35
  <link rel="canonical" href="<?php the_permalink(); ?>" />
36
  </head>
37
  <body>
38
+
39
+ <main role="main" class="center">
40
+
41
+ <?php if (have_posts()): ?>
42
+
43
+ <header class="entry-header">
44
+
45
+ <span class="hat">
46
+ <strong>
47
+ - <?php bloginfo('name'); ?>
48
+ -
49
+ <span dir="ltr"><?php bloginfo('url')?></span>
50
+ -
51
+ </strong>
52
+ </span>
53
+
54
  <?php while (have_posts()): the_post(); ?>
55
+
56
+ <h1 class="entry-title">
57
+ <?php the_title(); ?>
58
+ </h1>
59
+
60
+ <span class="entry-date">
61
+
62
+ <?php _e('Posted By', 'wp-print'); ?>
63
+
64
+ <cite><?php the_author(); ?></cite>
65
+
66
+ <?php _e('On', 'wp-print'); ?>
67
+
68
+ <time>
69
+ <?php the_time(sprintf(__('%s @ %s', 'wp-print'),
70
+ get_option('date_format'),
71
+ get_option('time_format')));
72
+ ?>
73
+ </time>
74
+
75
+ <span>
76
+ <?php _e('In', 'wp-print'); ?>
77
+ <?php print_categories(); ?> |
78
+ </span>
79
+
80
+ <a href='#comments_controls'>
81
+ <?php print_comments_number(); ?>
82
+ </a>
83
+
84
+ </span>
85
+
86
+ </header>
87
+
88
+ <div class="entry-content">
89
+
90
+ <?php print_content(); ?>
91
+
92
+ </div>
93
+
94
+ <?php endwhile; ?>
95
+
96
+ <div class="comments">
97
+ <?php if(print_can('comments')): ?>
98
+ <?php comments_template(); ?>
99
  <?php endif; ?>
100
  </div>
101
+
102
+ <footer class="footer">
103
+ <p>
104
+ <?php _e('Article printed from', 'wp-print'); ?>
105
+ <?php bloginfo('name'); ?>:
106
+
107
+ <strong dir="ltr">
108
+ <?php bloginfo('url'); ?>
109
+ </strong>
110
+ </p>
111
+
112
+ <p>
113
+ <?php _e('URL to article', 'wp-print'); ?>:
114
+ <strong dir="ltr">
115
+ <?php the_permalink(); ?>
116
+ </strong>
117
+ </p>
118
+
119
+ <?php if(print_can('links')): ?>
120
+ <p><?php print_links(); ?></p>
121
+ <?php endif; ?>
122
+
123
+ <p style="text-align: <?php echo ('rtl' == $text_direction) ? 'left' : 'right'; ?>;" id="print-link">
124
+ <a href="#Print" onclick="window.print(); return false;" title="<?php _e('Click here to print.', 'wp-print'); ?>">
125
+ <?php _e('Click', 'wp-print'); ?>
126
+ <?php _e('here', 'wp-print'); ?>
127
+ <?php _e('to print.', 'wp-print'); ?>
128
+ </a>
129
+ </p>
130
+
131
+ <?php else: ?>
132
+ <p>
133
+ <?php _e('No posts matched your criteria.', 'wp-print'); ?>
134
+ </p>
135
+ <?php endif; ?>
136
+
137
+ <p style="text-align: center;">
138
+ <?php echo stripslashes($print_options['disclaimer']); ?>
139
+ </p>
140
+ </footer>
141
+
142
+ </main>
143
+
144
+
145
  </body>
146
+ </html>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: GamerZ
3
  Donate link: http://lesterchan.net/site/donation/
4
  Tags: print, printer, wp-print
5
  Requires at least: 2.8
6
- Tested up to: 4.1
7
- Stable tag: 2.55
8
 
9
  Displays a printable version of your WordPress blog's post/page.
10
 
@@ -24,7 +24,7 @@ Displays a printable version of your WordPress blog's post/page.
24
  * Icons courtesy of [FamFamFam](http://www.famfamfam.com/)
25
 
26
  = Donations =
27
- I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks as my school allowance, I will really appreciate it. If not feel free to use it without any obligations. Thank You. My Paypal account is lesterchan@gmail.com.
28
 
29
  == Installation ==
30
 
@@ -41,8 +41,7 @@ Once installed take the following steps to set it up:
41
 
42
  = Usage =
43
 
44
- 1. Open `wp-content/themes/<YOUR THEME NAME>/index.php`
45
- You may place it in single.php, post.php, page.php, etc also.
46
  1. Find: `<?php while (have_posts()) : the_post(); ?>`
47
  1. Add Anywhere Below It: `<?php if(function_exists('wp_print')) { print_link(); } ?>`
48
 
@@ -68,7 +67,7 @@ Once installed take the following steps to set it up:
68
  1. Find: `<?php while (have_posts()) : the_post(); ?>`
69
  1. Add Anywhere Below It: `<?php if(function_exists('wp_print')) { print_link(); } ?>`
70
 
71
- Simply add this code <strong>inside the loop ### where you want the print link to display:
72
  <code>
73
  if(function_exists('wp_print')) {
74
  print_link();
@@ -84,12 +83,14 @@ if(function_exists('wp_print')) {
84
  * Do note that if you are using WP-Email, any text within [donotprint][/donotprint] will not be emailed as well.
85
 
86
  = Custom Template =
87
- * WP-Print will load 'print-css.css', '<strong>print-posts.php' and 'print-comments.php' from your theme's directory if it exists.
88
  * If it doesn't exists, it will just load the respective default file that comes with WP-Print.
89
  * This will allow you to upgrade WP-Print without worrying about overwriting your printing styles or templates that you have created.
90
 
91
 
92
  == Changelog ==
 
 
93
 
94
  = 2.55 =
95
  * NEW: Bump to 4.1
3
  Donate link: http://lesterchan.net/site/donation/
4
  Tags: print, printer, wp-print
5
  Requires at least: 2.8
6
+ Tested up to: 4.3
7
+ Stable tag: 2.56
8
 
9
  Displays a printable version of your WordPress blog's post/page.
10
 
24
  * Icons courtesy of [FamFamFam](http://www.famfamfam.com/)
25
 
26
  = Donations =
27
+ I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks as my school allowance, I will really appreciate it. If not feel free to use it without any obligations.
28
 
29
  == Installation ==
30
 
41
 
42
  = Usage =
43
 
44
+ 1. Open `wp-content/themes/<YOUR THEME NAME>/index.php`. You should place it in single.php, post.php, page.php, etc also if they exist.
 
45
  1. Find: `<?php while (have_posts()) : the_post(); ?>`
46
  1. Add Anywhere Below It: `<?php if(function_exists('wp_print')) { print_link(); } ?>`
47
 
67
  1. Find: `<?php while (have_posts()) : the_post(); ?>`
68
  1. Add Anywhere Below It: `<?php if(function_exists('wp_print')) { print_link(); } ?>`
69
 
70
+ Simply add this code inside the loop ### where you want the print link to display:
71
  <code>
72
  if(function_exists('wp_print')) {
73
  print_link();
83
  * Do note that if you are using WP-Email, any text within [donotprint][/donotprint] will not be emailed as well.
84
 
85
  = Custom Template =
86
+ * WP-Print will load 'print-css.css', 'print-posts.php' and 'print-comments.php' from your theme's directory if it exists.
87
  * If it doesn't exists, it will just load the respective default file that comes with WP-Print.
88
  * This will allow you to upgrade WP-Print without worrying about overwriting your printing styles or templates that you have created.
89
 
90
 
91
  == Changelog ==
92
+ = 2.66 =
93
+ * NEW: Updated print HTML code. Props @Luanramos
94
 
95
  = 2.55 =
96
  * NEW: Bump to 4.1
wp-print.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-Print
4
  Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
  Description: Displays a printable version of your WordPress blog's post/page.
6
- Version: 2.55
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: http://lesterchan.net
9
  Text Domain: wp-print
@@ -11,7 +11,7 @@ Text Domain: wp-print
11
 
12
 
13
  /*
14
- Copyright 2014 Lester Chan (email : lesterchan@gmail.com)
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
3
  Plugin Name: WP-Print
4
  Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
  Description: Displays a printable version of your WordPress blog's post/page.
6
+ Version: 2.56
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: http://lesterchan.net
9
  Text Domain: wp-print
11
 
12
 
13
  /*
14
+ Copyright 2015 Lester Chan (email : lesterchan@gmail.com)
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by