How can we help?
If you are looking for support for our PokaTheme, this is the place!
Home › Forums › PokaTheme support › Social Share problem
- This topic has 24 replies, 2 voices, and was last updated 1 year ago by admin.
-
AuthorPosts
-
June 7, 2023 at 9:19 am #17920Ricardo NunoParticipant
Hi,
When we try to do the sharing via social, we encounter some problems,
Share via twitter, is adding ” between the title. It should be clean.
Share via mail, adding strange characters to the subject of the email and the text of the email.
Thanks,
June 7, 2023 at 9:45 am #17924adminKeymasterHi Ricardo,
Thanks for pointing this out.
You can solve this by adding the following PHP code to your child theme’s functions.php. Also it will be solved in the next theme release.
function poka_social_share() { global $post; $permalink = esc_url( get_permalink( $post->ID ) ); $title = rawurlencode( get_the_title() ); ?> <ul class="social-icons"> <li> <a class="icon poka-facebook icon-btn icon-btn--gray jsSocialShareIcon" href="http://www.facebook.com/sharer.php?u=<?php echo esc_url( $permalink ); ?>" title="<?php esc_html_e( 'Share on Facebook', 'poka' ); ?>" data-width="520" data-height="350" rel="nofollow"></a> </li> <li> <a class="icon poka-twitter icon-btn icon-btn--gray jsSocialShareIcon" href="http://twitter.com/share?text=<?php echo esc_html( $title ); ?>&url=<?php echo esc_url( $permalink ); ?>" data-width="520" data-height="350" title="<?php esc_html_e( 'Share on Twitter', 'poka' ); ?>" rel="nofollow"> </a> </li> <li> <a class="icon poka-envelope icon-btn icon-btn--gray" href="mailto:?subject=<?php echo rawurlencode( __( 'I wanted you to see this site', 'poka' ) ); ?>&body=<?php echo rawurlencode( __( 'Check out this site:', 'poka' ) ); ?> <?php echo esc_url( $permalink ); ?>" data-width="520" data-height="350" title="<?php esc_html_e( 'Share by email', 'poka' ); ?>" rel="nofollow"> </a> </li> </ul> <?php }
June 7, 2023 at 1:15 pm #17929Ricardo NunoParticipantHi,
Thanks for the info.
I directly applied the fix on /inc/core/helpers.php
But, Regarding the email seems to have fixed, but in twiiter, there is still a problem with characters, in this case a title that has characters like: ”
Appears after ‘ ’
Example: title is “How to win ‘the bets’ knows how”
On share: How to win ‘the bets’ knows how https://..
PS: I take this opportunity to suggest adding more ways to share the post, such as whatsapp, telegram…
June 9, 2023 at 9:37 am #17940adminKeymasterHi again Ricardo,
I updated the code. Check the below:
function poka_social_share() { global $post; $permalink = esc_url( get_permalink( $post->ID ) ); $title = get_the_title(); ?> <ul class="social-icons"> <li> <a class="icon poka-facebook icon-btn icon-btn--gray jsSocialShareIcon" href="http://www.facebook.com/sharer.php?u=<?php echo esc_url( $permalink ); ?>" title="<?php esc_html_e( 'Share on Facebook', 'poka' ); ?>" data-width="520" data-height="350" rel="nofollow"></a> </li> <li> <a class="icon poka-twitter icon-btn icon-btn--gray jsSocialShareIcon" href="http://twitter.com/share?text=<?php echo wp_kses_post( $title ); ?>&url=<?php echo esc_url( $permalink ); ?>" data-width="520" data-height="350" title="<?php esc_html_e( 'Share on Twitter', 'poka' ); ?>" rel="nofollow"> </a> </li> <li> <a class="icon poka-envelope icon-btn icon-btn--gray" href="mailto:?subject=<?php echo rawurlencode( __( 'I wanted you to see this site', 'poka' ) ); ?>&body=<?php echo rawurlencode( __( 'Check out this site:', 'poka' ) ); ?> <?php echo esc_url( $permalink ); ?>" data-width="520" data-height="350" title="<?php esc_html_e( 'Share by email', 'poka' ); ?>" rel="nofollow"> </a> </li> </ul> <?php }
June 9, 2023 at 1:05 pm #17942Ricardo NunoParticipantI confirm that it is now ok!
Thank you
June 12, 2023 at 9:55 am #17943adminKeymasterYou’re welcome!
June 14, 2023 at 4:51 pm #17963adminKeymasterThis is just an update that we have released a new PokaTheme version and we have included a fix for this issue, too. Feel free to check your account downloads and get the latest version!
July 14, 2023 at 2:06 pm #18006Ricardo NunoParticipantHi,
I found today that the problem is not yet fully resolved.
If there is a “+” character in the title, it is blank at the time of sharing.
Example title: “Top Casinos + Top Bets”, if your share, “Top Casinos Top Bets http….”.
July 20, 2023 at 9:25 am #18016adminKeymasterHi Ricardo,
Thanks for pointing this out, we’ll check it and provide a fix for it if necessary in the next theme release.
July 20, 2023 at 12:46 pm #18017Ricardo NunoParticipantHi,
If possible, you can post the fix here too (if it’s easy), and thus avoid waiting for a new update.
Thanks,
-
AuthorPosts
- You must be logged in to reply to this topic.