Some solutions for WP-Print and WP-Mail
-
Hi,
You find bellow solutions for:
1) Don’t print or email Post(Event) otherwise you receive a 404 error.
Print only Page or Post(Article)
2) Don’t print some numbers of page.
3) Print “Print this page” and “email this page” with right and left align on same lineSolutions:
1) Code this line in all template single.php, page.php, post.php, … after the <?php the_content(); ?>
<?php load_template (get_template_directory() . ‘/includes/print.php’); ?>
2) create a new print.php file in the include directory and copy the following code:
<?php
// create Array for posts/pages ID’s for that you don’t want to Wp-Print icon shown…
$noprint = “34”; // A Propos
$noprint = $noprint . “,623”; // Espace-Prive
$noprint = $noprint . “,133”; // Contact
$noprint_list = preg_split(“/[\,]+/”, $noprint);
$thePostID = $post->ID;
// Print and Email only Post(Article) or Page. Not Post(Event)
if (( get_post_type() == ‘post’) || ( get_post_type() == ‘page’)):
if(! in_array($thePostID,$noprint_list)):
if(function_exists(‘wp_print’)):
echo ‘<p style=”text-align:left;”>’;
print_link();
echo ‘<span style=”float:right;”>’;
email_link();
echo ‘</span></p>’;
endif;
endif;
endif;
?>Good luck
- The topic ‘Some solutions for WP-Print and WP-Mail’ is closed to new replies.