-
AuthorPosts
-
February 5, 2016 at 1:49 pm #578487
Hello,
I have 2 problem on social media share links.
1)
I want custom title for social media links.
ex.
title = Best Theme Enfold
Reading time plugin (do_shortcode(“[est_time]”) = 2 minutes
*result (must be)= Best Theme Enfold | 2 minutes
How can i put this shortcode or any string ?2) When i was sharing any page result is any social websites;
Title ” Best Theme Enfold – My Web Page ”
How can i remove “my web page ” textThanks for helpss
Regards.
February 7, 2016 at 7:18 am #579132Hey koraytastan!
Thank you for using Enfold.
1.) Are you referring to the social share links or the social media icons in the top bar? If it is the latter, you can modify the includes > helper-social-media.php file. Look for this code around line 83 which contains the social media icon markup including the title attribute:
$html .= "<a {$blank} href='".$icon['social_icon_link']."' ".av_icon_string($icon['social_icon'])." title='".ucfirst($icon['social_icon'])."'><span class='avia_hidden_link_text'>".ucfirst($icon['social_icon'])."</span></a>";
If it is the social share section in the posts, use the “avia_social_share_link_arguments” filter. Example here: https://kriesi.at/support/topic/share-button-twitter-handle-not-showing-when-people-are-sharing/#post-578267
2.) Use the “avia_social_share_link_arguments” in order to change the share section pattern. https://kriesi.at/support/topic/share-button-twitter-handle-not-showing-when-people-are-sharing/#post-578267
Regards,
IsmaelFebruary 7, 2016 at 4:43 pm #579191Thanks for reply Ismael,
But i could not tell you exactly.Sorry.
title = Best Theme Enfold
Reading time plugin shortcode = [est_time]helper-social-media.php (maybe 150 line)
'linkedin' => array("encode"=>true, "encode_urls"=>false, "pattern" => "http://linkedin.com/shareArticle?mini=true&title=[title] - ".do_shortcode('[est_time]').""),
Sharing content title result = Title – “.do_shortcode(‘[est_time]’).” – My Web Site
I want = Title – 2 minutes
(i also don’t want “My Web Site” text in sharing content title.Thanks
February 7, 2016 at 9:23 pm #579237Hey!
Replace your code with the following and try again
'linkedin' => array("encode"=>true, "encode_urls"=>false, "pattern" => "http://linkedin.com/shareArticle?mini=true&title=[title] - ' .do_shortcode('[est_time]'). ' "),
Let us know if that helps
Regards,
BasilisFebruary 8, 2016 at 12:09 am #579282Thanks for reply but result is :
Title – My Web Site Namealso linkedin giving link error.
:(February 10, 2016 at 11:00 am #580960Hi!
can you provide us a link to your site showing the elements in question please? we need to be able to inspect the elements.
Cheers!
AndyFebruary 10, 2016 at 3:07 pm #581166Title: “2016’da Kaçırmamanız Gereken 5 Tasarım Trendi”
Read Time(below title) = “2 dakika”When i was sharing link result is must be = “2016’da Kaçırmamanız Gereken 5 Tasarım Trendi – 2 dakika”
Thanks..
February 12, 2016 at 10:45 am #582135Hey!
Where did you get the shortcode? Is it possible to get the value of the shortcode via custom field? https://codex.wordpress.org/Custom_Fields
Please try this in the functions.php file:
// modify social share args add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1); function avia_add_social_share_link_arguments($args) { $readtime = do_shortcode('[est_time]'); $args['linkedin']['pattern'] = 'http://linkedin.com/shareArticle?mini=true&title=[title]'.$readtime.'&url=[permalink]'; return $args; }
The example below works on our installation but I’m not sure if it is going to work with the custom shortcode above:
// modify social share args add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1); function avia_add_social_share_link_arguments($args) { $readtime = get_the_time(get_option('date_format')); $args['linkedin']['pattern'] = 'http://linkedin.com/shareArticle?mini=true&title=[title]'.$readtime.'&url=[permalink]'; return $args; }
Regards,
IsmaelFebruary 12, 2016 at 12:45 pm #582183Thanks Ismael. It’s working. How can i add facebook, twitter links ?
February 14, 2016 at 9:55 am #582898Hey!
Add the pattern below the existing one. For facebook and twitter, something like this will work:
$args['facebook']['pattern'] = 'http://www.facebook.com/sharer.php?u=[permalink]&t=[title]'; $args['twitter']['pattern'] = 'https://twitter.com/share?text=[title]&url=[shortlink]';
Add the shortcode variable inside the text query. You can find the social patterns inside the helper-social-media.php file starting from line 147.
Best regards,
IsmaelFebruary 14, 2016 at 8:57 pm #582992Twitter is working on function.php but facebook pattern result is only title.
February 18, 2016 at 7:27 pm #585608Hi!
Does it work if you do the modification in the main file, /includes/helper-social-media.php (line 147)?
'facebook' => array("encode"=>true, "encode_urls"=>false, "pattern" => "http://www.facebook.com/sharer.php?u=[permalink]&t=[title]"),
Cheers!
JosueFebruary 19, 2016 at 2:10 pm #586058Thanks
İ solved the problem.
in functions.php. “&t” must be “&title”
$args['facebook']['pattern'] = 'http://www.facebook.com/sharer.php?u=[permalink]&title=[title]⌛'.$readtime.'';
-
AuthorPosts
- The topic ‘Custom title’ is closed to new replies.