-
AuthorPosts
-
February 2, 2020 at 11:03 pm #1180712
Hi guys,
some time ago you gave me the following code to insert “via @…” for Twitter sharing:
/*TWITTER SHARING CUSTOMIZATION*/ add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1); function avia_add_social_share_link_arguments($args) {$args['twitter'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://twitter.com/share?text=[title]&url=[shortlink]&via=Anton_Malafeev"); return $args;}
Is that possible to add the same “via @…” to the Facebook share button ? I’d like to make people sharing via one of my FB pages.
Cheers,
February 5, 2020 at 9:51 am #1181670Hi Anton,
I’m not very familiar with via in facebook but if you want to add it in the url, you can do that, you can use this code (combined with your twitter sharing code above):
function avia_add_social_share_link_arguments($args) { $args['twitter'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://twitter.com/share?text=[title]&url=[shortlink]&via=Anton_Malafeev"); $args['facebook'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://www.facebook.com/sharer.php?u=[permalink]&t=[title]"); return $args; } add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
Best regards,
NikkoFebruary 11, 2020 at 8:18 pm #1183658Hi Nikko,
thank you for this attempt, but I did not manage to get this line of code to work. I tried this
$args['facebook'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://www.facebook.com/sharer.php?u=[permalink]&t=[title]&@AntonMalafeev"); return $args;
and
$args['facebook'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://www.facebook.com/sharer.php?u=[permalink]&t=[title]&via=AntonMalafeev"); return $args;
none works.
Maybe we should use another syntax?February 12, 2020 at 5:06 am #1183743Hi Anton,
I tried to check on facebook: https://developers.facebook.com/docs/plugins/share-button/ but I could not find ‘via’ as a parameter.
If you can give a link that points out the right parameter on the url that is permitted by facebook, please do so and we’ll try to give you an accurate code.Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.