Tagged: enfold, Social toolbar
-
AuthorPosts
-
February 6, 2015 at 11:10 pm #392334
Hello!
Re the social toolbar (see bottom of this page: http://www.tripreads.com/istanbul)
All of the icons, when clicked direct to the “pretty” permalink, except Twitter, which links to http://www.tripreads.com/?p=19.
Any way to fix this? I’m using the Enfold child theme.
Thanks!February 6, 2015 at 11:16 pm #392337Hey Jennifer!
It doesn’t because of the Twitter character limit, if you want to change it you’d need to edit
/includes/helper-social-media.php
and change line 147:'twitter' => array("encode"=>true, "encode_urls"=>false, "pattern" => "https://twitter.com/share?text=[title]&url=[shortlink]"),
To:
'twitter' => array("encode"=>true, "encode_urls"=>false, "pattern" => "https://twitter.com/share?text=[title]&url=[permalink]"),
To have this mod on a child theme you can copy the whole
avia_social_share_links
class to your child functions.php.Regards,
JosueFebruary 6, 2015 at 11:22 pm #392342Ah – I thought that URLs were shortened to a specific character length regardless of link length.
Nevertheless, very helpful. Thank you!February 7, 2015 at 2:51 am #392381You are welcome, glad to help :)
Cheers!
JosueFebruary 23, 2015 at 2:27 am #400346Hello again. This was super helpful — one follow up question though. The share options are coded to pull the WordPress page title rather than its SEO title. Is there another shortcode that I can substitute for text=[title] to have it pull the SEO title instead?
Here’s an example:
http://www.tripreads.com/italy/
Twitter (and others) currently pulls only “Italy” rather than “Italy Travel Reading List”
Thanks!February 23, 2015 at 4:04 am #400360Hey!
Try changing this line:
$replace['title'] = !isset($this->post_data['title']) ? get_the_title() : $this->post_data['title'];
To:
$replace['title'] = get_post_meta($post->ID, '_yoast_wpseo_title', true);
Best regards,
JosueApril 20, 2015 at 3:59 am #431040Hi! Finally getting a chance to revisit this. Thank you for the code – that works for the other social networks, but not Twitter. For Twitter, it leaves a blank space. Any suggestions? Thank you!
April 20, 2015 at 8:13 am #431145Hm, that’s strange. Can you please create us a WordPress administrator account? post it here as a private reply.
Regards,
JosueApril 20, 2015 at 7:12 pm #431526This reply has been marked as private.April 21, 2015 at 1:12 am #431688Hi Jennifer!
Should work now, check it.
Cheers!
JosueApril 21, 2015 at 4:51 am #431724Works! Thank you, Josue :)
April 21, 2015 at 5:18 am #431743You are welcome, glad to help :)
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.