WordPress.org

Support

Support » Plugins and Hacks » myCRED » myCred for Sharing Post into facebook,twitter,google plus?

myCred for Sharing Post into facebook,twitter,google plus?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Gabriel

    @designbymerovingi

    Hi.

    Right now there is no third-party plugin that supports awarding points for sharing of posts. But there is a tutorial on the myCRED website where you can award points when a user clicks on “Share on Facebook” etc. via a custom shortcode.

    The problem is that unless you use a social media app that tells your website that someone has successfully shared a post, there is no notifications from i.e. Facebook letting us know that a user has shared a post.

    You can find a complete list of plugins that myCRED supports on the myCRED Supported Plugins page.

    xblackbonex

    @xblackbonex

    idk if this is available too..
    I need to make a button, that will cost x mycred points
    once it’s clicked it will show download links..
    is it available?
    thanks 🙂

    xblackbonex

    @xblackbonex

    I went to plugins, mycred – edit:
    I added the code:

    add_shortcode( 'mycred_share_this', 'mycred_render_shortcode_share_this' );
    function mycred_render_shortcode_share_this( $attr, $link_title )
    {
    	// Get URL (we assume you only use this shortcode inside the loop)
    	$url = get_permalink();
    
    	// Append social media share urls
    	if ( $attr['href'] == 'facebook' )
    		$attr['href'] = 'https://www.facebook.com/sharer/sharer.php?u=' . urlencode( $url );
    	elseif ( $attr['href'] == 'twitter' )
    		$attr['href'] = 'http://twitter.com/home?status=' . urlencode( $url );
    	elseif ( $attr['href'] == 'google' )
    		$attr['href'] = 'http://plus.google.com/share?url=' . urlencode( $url );
    	elseif ( $attr['href'] == 'pinterest' )
    		$attr['href'] = 'http://pinterest.com/pin/create/button/?url=' . urlencode( $url );
    
    	// Always make links open in a new window
    	$attr['target'] = '_blank';
    
    	// Pass it on
    	return mycred_render_shortcode_link( $attr, $link_title );
    }

    before the comments at the end of the script,
    then added the shortcode into one of my posts:
    [mycred_share_this]
    I get the error error Anchor missing URL!

    http://gyazo.com/15f54850c48f4a3d197248de5933996c.png

    Plugin Author Gabriel

    @designbymerovingi

    Have you had a look at the Sell Content add-on in myCRED?

    You can select to sell entire post contents or parts of it. You could wrap your download links with the mycred_sell_this shortcode which will force users to pay to see the download links. Everything else in your post content outside this shortcode will be visible.

    Plugin Author Gabriel

    @designbymerovingi

    Why are you putting this code in the myCRED plugin? You will loose this the next time you update myCRED! As explained in the tutorial, the code goes in your themes functions.php file.

    As the error message suggests, you must enter which site you want to share with. You do this via the href attribute.

    You can find more information if you have a read though the tutorial.

    xblackbonex

    @xblackbonex

    hello,
    I added the script into my theme’s functions.php

    http://gyazo.com/fe8c799a596dce3320512c4bffab5d85

    also, the shortcode didn’t work:

    http://gyazo.com/c111579de65ca1394070e79b592b05c8

    :s

    Plugin Author Gabriel

    @designbymerovingi

    I answered your new post.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘myCred for Sharing Post into facebook,twitter,google plus?’ is closed to new replies.
Skip to toolbar