1

I want an easy way to automatically implement printing, Facebook sharing, and Tweeting for posts. No plugins, complicated javascript, nor functions.

closed as off-topic by s_ha_dum, gmazzap, Krzysiek Dróżdż, tfrommen, Chip Bennett Dec 16 '13 at 17:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should be specific to WordPress within defined scope (merely happening in its context, such as generic PHP/JS/HTML/CSS, is insufficient). Might be better asked at Stack Overflow or other appropriate site of Stack Exchange network." – s_ha_dum, gmazzap, Krzysiek Dróżdż, tfrommen, Chip Bennett
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Can you add more details about the issue you are facing? – Maruti Mohanty Dec 9 '13 at 13:40
  • 1
    I'm not facing an issue. I'm presenting a potential solution to help others... I would answer my own question, but I don't have enough reputation. – Natan Dec 9 '13 at 15:00
  • 2
    @Natan Everyone can answer the own question. You just have to wait a little bit longer. – fuxia Dec 9 '13 at 15:22
  • Whoops. My mistake. #_# – Natan Dec 9 '13 at 15:27
1

I decided to use the built in Facebook sharer and Twitter sharer links, as provided on each site. It won't give complete functionality, but it it's perfect for a simple custom icon.

Note: This will only work properly within 'the loop'

HTML code to be inserted in your page template:

<div class="social_icons">
    <a href="javascript:window.print()" target="_blank" class="printIcon">
       Print page
    </a>
    <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo get_permalink(); ?>" target="_blank" class="facebookIcon">
       Share on Facebook
    </a>
    <a href="https://twitter.com/share?text=<?php echo get_the_title(); ?>+&ndash;+" target="_blank" class="twitterIcon">
       Tweet on Twitter
    </a>
</div>

Basic CSS styling:

.social_icons {
    float: right; /*change for your specific needs*/
}

.social_icons a {
    text-indent: -9999px;
    height: 50px; /*change for your specific needs*/
    display: block;
    float: right; /*change for your specific needs*/
}

.social_icons a.printIcon {
    background-image: url(); /*add a custom share icon*/
    background-repeat: no-repeat;
}

.social_icons a.facebookIcon {
    background-image: url(); /*add a custom share icon*/
    background-repeat: no-repeat;
}

.social_icons a.twitterIcon {
    background-image: url(); /*add a custom share icon*/
    background-repeat: no-repeat;
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.