queue  41
support
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Sharebuttons

  1. #1

    Sharebuttons

    Hi Ante,

    I would like to add sharebuttons for facebook, twitter, linkedin and email to the footer of the black and red article blocks on my blog posts, so people can share a link to the article on my site easily with others. As this is something you see a lot on other blogs I assume there must be some codesnippets I could use to implement this. Do you have some suggestions how to implement this? Thanks.

  2. #2
    Lead Support Ante's Avatar
    Join Date
    Oct 2012
    Posts
    16,930
    Hi,

    you would have to modify loop-alternate.php

    Below this:
    PHP Code:
    <div class="post-meta">
        <a href="<?php echo $link ?>" class="link">Read More</a>
        <a href="<?php echo $link ?>" class="comments"><?php echo __pe("Comments "); ?> (<?php $t->content->comments() ?>)</a>
    </div>
    add this:
    PHP Code:
    <div class="post-share">
        <iframe src="//www.facebook.com/plugins/like.php?href=<?php echo $epermalink?>&amp;send=false&amp;layout=button_count&amp;width=110&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=recommend&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:21px; margin-left: 10px;" allowTransparency="true"></iframe>
        <a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php echo $permalink?>">Tweet</a>
        <script type="IN/Share" data-url="<?php echo $permalink?>" data-counter="right"></script>
    </div>
    Below this:
    <!--end post-->

    <?php endwhile; ?>

    add this:
    PHP Code:
    <script src="//platform.linkedin.com/in.js" type="text/javascript">
    langen_US
    </script>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> 
    And below this:
    PHP Code:
    <?php $t =& peTheme(); ?>
    <?php $content 
    =& $t->content?>
    <?php 
    while ($t->content->looping() ) : ?>
    add this:
    PHP Code:
    <?php $permalink get_permalink(); ?>
    <?php $epermalink 
    urlencode$permalink ); ?>
    For styling, you can use .post-share class, there is no email button, you would have to design it yourself as there is no service for that, that I know of.

  3. #3
    Hi there,

    Thanks, I am pretty sure this works, but as you might remember my loop-alternate page has got quite some modifications. I planned to send you my current page so you can take a look at it as well as a screenshot that illustrates what i have in mind, but I can't find the pixel entity email address anymore. The form does not allow me to attach a file. Can you mail me the support email address. Thanks.

  4. #4
    Lead Support Ante's Avatar
    Join Date
    Oct 2012
    Posts
    16,930
    You can send it to my email: antesepic at gmail dot com

  5. #5
    Hi Ante,

    Did you receive my mail, or do I need to resend it? Thanks

  6. #6
    Lead Support Ante's Avatar
    Join Date
    Oct 2012
    Posts
    16,930
    Hi, email received.

    I got home late so will look into it tomorrow morning, thanks for your patience.

  7. #7
    Lead Support Ante's Avatar
    Join Date
    Oct 2012
    Posts
    16,930
    Hey,

    can you please resend your mail, I can't find it no matter how much I search, and I know for a fact I have received it :S

    Thanks

  8. #8
    No problem. I've send it again.

  9. #9
    Lead Support Ante's Avatar
    Join Date
    Oct 2012
    Posts
    16,930
    Hey, one question. Which url should be shared? The one that leads to single article page on yoru site or the blog page with that article id as an url (to make article black and come up first) ?

  10. #10
    Hi there,

    What should happen is that the user who presses the shared link lands at the insights page with all articles in red boxes and the one shared article in a black box as the first item. Exactly like it works right now when someone clicks on an article link via rss or an article I shared via my activity feed on LinkedIn. So the user, should arrive at the insights page first and then - by pressing read more in the selected black box article, or a red box article if he changes his mind on the insights page - jumps to the external site. So everything travels through the insights page on my site. Got it :-)