WordPress.org

Forums

myCRED
[closed] myCred for Sharing Post into facebook,twitter,google plus? (8 posts)

  1. xblackbonex
    Member
    Posted 1 year ago #

    it will be a good feature if you sir, added that script into mycred
    my other question is, is it available by a third party plugin?

    http://wordpress.org/plugins/mycred/

  2. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. xblackbonex
    Member
    Posted 1 year ago #

    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 :)

  4. xblackbonex
    Member
    Posted 1 year ago #

    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

  5. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  6. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  7. xblackbonex
    Member
    Posted 1 year ago #

    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

  8. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    I answered your new post.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic