Error 

Printing Pages with wp2pdf

627 views
Posted July 7, 2006 at 09:07am in Programming, Wordpress

When I installed wp2pdf I was only able to print posts, but since I am offering tutorials and articles on the site I wanted to make sure you guys could have a offline copy available. These are the changes I had to make to get it to work properly.

wp2pdf v0.4.2

Start by opening wp2pdf.php and add

$wp2pdf_bln = TRUE;

to line 26

Change directories to wp-includes and open classes.php

Open that file and add

global $wp2pdf_bln;

to line 594

Replace line

} elseif ($this->is_single) {

on line 599 with

} elseif (($this->is_single) && !$wp2pdf_bln) {

The last part is to go to line 601 and add

} elseif ($wp2pdf_bln == TRUE) {
$where .= ' AND (post_status = "static")';

What we have done is set a variable stating that we want to print pages and when it starts to build the SQL query it will check if it is a static page and that our variable is not TRUE. If it is true it will add

post_status = "static"

to our SQL query. It works and it hasnt screwed anything up.

  • Google
  • del.icio.us
  • Digg
  • Spurl
  • Facebook


Leave a Reply