ThemeShaper Forums » Thematic

[closed]

how to print and send by email the posts from my blog???

(10 posts)
  • Started 5 years ago by Sandraniubo
  • Latest reply from JimDandy
  • This topic is resolved
  1. Sandraniubo
    Member

    Hi!, i'm in my start with WP, and thematic, i need to send by e-mail and print the posts of my blog, wich pluggin do i have to install, ore what do i have to do??

    Posted 5 years ago #
  2. Hey & welcome on board!

    Could you please give me some more details. The Print part is ok.

    The Email Part:
    Do you want something like a subscription list for your posts? .. or do you need something like 'Nice post .. I'm going to mail this to a friend?'

    Cheers,

    Chris

    Posted 5 years ago #
  3. Sandraniubo
    Member

    Hi Chris!, and thanks for asking,

    the thing about the Email part, I need to have the option of send to a "friend" the content of the post

    Posted 5 years ago #
  4. Hey,

    sorry .. still working on it. Found WP-Email and WP-Print, started to test both plugins and ended up with a messed up page for entering the email data.

    Cheers,

    Chris

    Posted 5 years ago #
  5. Sandraniubo
    Member

    thanks for your help, i hope my question will not to take you a lot of time to resolve..
    but it will be great!

    i wait for more info,

    cheers,

    Sandra

    Posted 5 years ago #
  6. Hey Sandra,

    went better than I thought .. It was more a thing how to ship around the weird display I got.

    Install and activate the following plugins:

    WP-Email - Documentation

    and

    WP-Print - Documentation

    .. and don't forget to re-Generate the Permalink (WP-Admin -> Settings -> Permalinks -> Save Changes)

    For WP-Email: It is important that you set E-Mail Link Type to 'E-Mail Popup' otherwise you'll end up with the same weird display.

    For WP-Print: you might want to set Print Links to 'No'

    Normally you would need to edit the theme files to integrate both plugins. We're doing some magic here. Copy the following code into your functions.php:

    function my_display_hook($content='') {
    	if (is_single() || is_page()) { // the icons / textlinks will only show up on a single post or a page
    		$content .= "\n<div class=\"wp-email\">\n" . do_shortcode('[email_link]') . "</div>";
    		// take the content, add a div class, add the shortcode, do some magic and close the div
    		$content .= "\n<div class=\"wp-print\">\n" . do_shortcode('[print_link]') . "</div><br />";
    	}
    	return $content; // return the changed content
    }
    add_filter('the_content', 'my_display_hook'); // connect this filter to the_content

    Now we need change the position of the icons .. copy the following code to your child theme's style.css:

    div.wp-email a img {
    	margin-bottom: -1px;
    }
    
    div.wp-print a img {
    	margin-bottom: -1px;
    }

    This is just the basic styling which should give you an idea where and how to do more if needed.

    Tested with Thematic 0.9 and the basic child theme coming from the directory thematic\thematic-sample-child-theme.

    I haven't tested the E-Mail Setup itself. Any questions related to WP-Email and WP-Print will be answered in the Plugins Forums.

    Cheers,

    Chris

    Posted 5 years ago #
  7. lqunta
    Member

    Greetings Chris,

    Is it possible, on the above code, to add other 'links', a good visual example is http://wpmodder.com/secondary-html-content-plugin-video-overview-728.html#more-728 [basically here, what makes sense in reference to this post, is the 'help spread the word' section.

    Any further ideas will be of great help.

    Cheers
    LQunta

    Posted 4 years ago #
  8. Hello Chris,

    I am new at PHP and could use a little help.

    Would you help me with this? I want to add a non-breaking space between the e-mail link and the print link.

    This is what I have now.

    // You can e-mail and print the posts
    function my_display_hook($content='') {
    	if (is_single() || is_page()) { // the icons / textlinks will only show up on a single post or a page
    		$content .= "\n<div class=\"wp-email\">\n" . do_shortcode('[email_link]') . do_shortcode('[print_link]') . "</div>";
    	}
    	return $content; // return the changed content
    }
    add_filter('the_content', 'my_display_hook'); // connect this filter to the_content

    I would like to have a space here:

    // You can e-mail and print the posts
    function my_display_hook($content='') {
    	if (is_single() || is_page()) { // the icons / textlinks will only show up on a single post or a page
    		$content .= "\n<div class=\"wp-email\">\n" <A_SPACE_WOULD_BE_HERE> do_shortcode('[email_link]') . do_shortcode('[print_link]') . "</div>";
    	}
    	return $content; // return the changed content
    }
    add_filter('the_content', 'my_display_hook'); // connect this filter to the_content

    Thanks
    Jamielt

    Posted 4 years ago #
  9. Hey! I just tried this and it worked.

    // You can e-mail and print the posts
    function my_display_hook($content='') {
    	if (is_single() || is_page()) { // the icons / textlinks will only show up on a single post or a page
    		$content .= "\n<div class=\"wp-email\">\n" . do_shortcode('[email_link]') . ' <span class="meta-sep meta-sep-edit"> &nbsp; </span> ' . do_shortcode('[print_link]') . "</div><br />";
    	}
    	return $content; // return the changed content
    }
    add_filter('the_content', 'my_display_hook'); // connect this filter to the_content
    Posted 4 years ago #
  10. JimDandy
    Member

    Sorry this is a very old thread, but hope someone might have an idea on how to use wp-print (no longer maintained, but still working) with a static page just populated by links (aka, a blogroll). I had already come up with my own functions.php block to make the wp-print icon and text show up, and I've now substituted Chris' version. I also have another block for my posts:

    //add print button at bottom of posts
    function wp_print_include_posts() {
    	if((function_exists('wp_print')) && !is_single() && !is_page()) {
    		echo '<div class="wp_print_post">'. "\n";
    		print_link();
        	echo '' . "\n" . '</div><!-- .wp_print_post -->'. "\n";
    	}
    }
    add_filter('thematic_belowpost','wp_print_include_posts');

    but on my Links page, the wp-print icon and text show up just below the page title and description, because the links loop is generated dynamically from links items in the DB, and all that prints is the page title and description. The question is, is there any way to print all of the links as well (and preferably not one-by-one). Thanks.

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.