Print this article button
Installation
Classic installation method here. It is delivered with a few options:
Integration
you get the print icon adding the code <?php if ( function_exists(‘print_link’ ) print_link(); ?> in single.php for example.
Incompatibility with the zdmultilang plugin
My problem was to make it work with the zdmultilang plugin …
Indeed there seems to be an incompatibility at url level, that inhibits wp-print when zdmultilang adds its /fr at the beginning of the url.
I bypassed this problem changing three lines of the wp-print plugin, in the wp-print.php file, print_link() function:
// global $id; global $id, $CurrentLanguagePermalink; // $using_permalink =get_option('permalink_structure'); $using_permalink = false; // $print_link = get_permalink(); $print_link = "/cms/wordpress/?p=$id&lang=$CurrentLanguagePermalink";
Explanation
The aim is to keep your blog’s clean urls, but to add a “dirty” link on the printer’s icon.
If your blog is at your site’s root, the 3rd line would read:
$print_link = "/?p=$id&lang=$CurrentLanguagePermalink";
This trick only works with posts, I didn’t bother to look any further as I didn’t need it!
Last, here’s what integration in my theme looks like:
<?php if(function_exists(‘print_link’)) { ?>
<img src=”/cms/wordpress/wp-content/themes/inove/icons/imprimante16.png” align=”texttop” alt=”print” />
<a href=”/cms/wordpress/?p=<?php echo $post->ID; ?>&lang=<?php echo $CurrentLanguagePermalink; ?>&print=1″><?php _e(‘print’, ‘inove’); ?></a>
<?php } ?>
Suggestions de lecture
Spread this post over the world!
How did you like this post?
Please don't go without leaving a mark!
French












Content d’avoir pu te rendre service, et merci pour les encouragements :O)
Like or Dislike:
2
2
Bonjour
Merci pour cet article qui a résolu mon problème entre zdmultilang et wp-print !
Bravo, continue, toutes tes infos et tes conseils nous aident bien !
Like or Dislike:
1
1