Lewis' Blog Tales from the trenches of information technology

1Jan/130

Removing the WP Post to PDF icon in WPTouch

Download PDF

I recently added (and slightly enhanced the usability of) the WP Post to PDF plugin for WordPress (more on my tweaks in a later post). The plugin utilizes the TCPDF class for creating PDFs of selected pages and/or posts on a WordPress blog.

What I discovered, however, was that the plugin doesn't seem to want to play nicely with WPTouch (broken pdf links). I was going to address that, but decided that a more practical approach would be to just disable the icon altogether, if only to regain the screen real estate otherwise surrendered to the image.

Movie A Dog's Purpose (2017)

It turns out that this was actually much easier than it originally seemed (as I'm no css whiz). The secret lies in the WPTouch style.css itself. This file is buried in wp-content/plugins/wptouch/themes/default. At the bottom of the file are a number of similar "maskings" done for various other extensions, such as:

/* @group Social Share */

.leftcontainerBox {
	display: none !important;
}

/* @end */

All that was required was for me to add a similar block for WP Post to PDF, as in:

/* @group WP Post to PDF */

a.wpptopdf {
	display: none !important;
}

/* @end */

Done!

Next up: Discover/build nice print & email post icons, themed to match the pdf icon.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.