• Resolved monitor

    (@oomskaap)


    Hi Gabriel,

    We use the “Credits for clicking on links” hook and it works very good as a regular link, which works great:
    <?php echo do_shortcode('[mycred_link amount="5" href="https://www.tumblr.com/blog/blahblahblah" target="_blank"]<img src="/wp-content/themes/Boke81/profile/images/proft.png" alt="" />[/mycred_link]'); ?>

    However, I am curious if this can be used in social sharing icons, and if so, please give me an example on how to incorporate that hook with a template button code like this:
    link 1:
    <a href="https://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>" target="blank" ><img src="https://www.domain.com/wp-content/themes/hehe/images/f.png"></a>

    link 2:

    <a href="https://www.tumblr.com/share" title="Share on Tumblr" style="display:inline-block; text-indent:-9999px; overflow:hidden; width:20px; height:20px; background:url('https://platform.tumblr.com/v1/share_4.png') top left no-repeat transparent;">Share on Tumblr</a>

    Link 3:

    <a href="https://fancy.com/fancyit?Category=Other">Fancy</a><script type="text/javascript">(function(){var id="fancy-btn",d=document,f=d.getElementsByTagName("script")[0];if(!d.getElementById(id)){var s=d.createElement("script");s.id=id;s.src="//fancy.com/fancyit.js";f.parentNode.insertBefore(s,f);}})();</script>

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author myCred

    (@designbymerovingi)

    Hi oomskap.

    You need to wrap code as I cant see half of it or preferably, use pastebin.

    Thread Starter monitor

    (@oomskaap)

    Sorry, here you go:

    https://pastebin.com/U5cdpjjs

    Plugin Author myCred

    (@designbymerovingi)

    Have you had a look at the “Awarding points for users who “Share” a post” tutorial?

    Thread Starter monitor

    (@oomskaap)

    I’ll have a look thanks. It seems liks like the above cannot be in shortcodes due to the javascripts I guess.

    Just one question. Would floating “divs” ever be possible to award points when clicked? I just had the idea that you can create an invisible div with href around any social button, and when clicked in that area it gives points regardless of what fires behind the button. Or is something like this not possible?

    Plugin Author myCred

    (@designbymerovingi)

    If you float a div above the button you will not be able to press that button, you can float it behind but then they need to click on that background.

    If you have a button, you can add jQuery to the page that listens on clicks and then using ajax awards points. But that is the exact same thing the tutorial does but instead of buttons you use an anchor element.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Complicated Link href question’ is closed to new replies.