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'] = 'https://twitter.com/home?status=' . urlencode( $url );
elseif ( $attr['href'] == 'google' )
$attr['href'] = 'https://plus.google.com/share?url=' . urlencode( $url );
elseif ( $attr['href'] == 'pinterest' )
$attr['href'] = 'https://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!
https://gyazo.com/15f54850c48f4a3d197248de5933996c.png