Short link for article sharing

Posted in: Newspaper
Post count: 39

Hello

Is there any way to use a short link (post id parmalink) for the feature of social sharing & Copy link in single article (the built it widget from newspaper) ?

Post count: 21065

Hello @gorthi !

In order to avoid misunderstandings, please provide more information(screenshots/video) about what exactly is the issue there and what exactly you need to achieve.

A solution for sending a screenshot/video is this:
Download, capture, and send: https://www.techsmith.com/jing-tool.html
After making the screenshot, you will have a link; paste it here.

Thank you!

Post count: 39

So when going to any article on the website, and press the “copy link” from the tagdiv widget as shown here : https://imgur.com/a/F5oC47a

It copies the full link like this : https://halacanada.info/canada/%d9%86%d9%85%d9%88-%d8%a7%d9%84%d8%a7%d9%82%d8%aa%d8%b5%d8%a7%d8%af-%d8%a7%d9%84%d9%83%d9%86%d8%af%d9%8a-%d8%a8%d9%86%d8%b3%d8%a8%d8%a9-0-2-%d8%a8%d8%a7%d9%84%d9%85%d8%a7%d8%a6%d8%a9/

Is there any way to make it copy a short link such as : https://halacanada.info/?p=1030

Which takes to the same article but with an id instead of full parmalink.

Post count: 21065

Hello @gorthi !

Unfortunately, no.

Thank you!

Post count: 39

Can you please tell me where the code of this sharing widget in stored in the theme ?

I’ll try to customize it for that purpose

Post count: 21065

Hello @gorthi !

Check on this path: td-composer/legacy/common/wp_booster/td_social_sharing.php on 1357 line

Thank you!

Post count: 39

Hello Bettina,

I found out a way to make it happen with this code :
case 'copy_url':
// Assuming $post_id is the ID of the current WordPress post
$post_id = get_the_ID();

if ($post_id) {
$post_permalink = home_url("?p=$post_id");
return array(
'url' => $post_permalink,
'title' => 'Copy URL'
);
} else {
return array(
'url' => home_url(),
'title' => 'Copy URL'
);
}
break;

Is there any way to keep this change upon updates please ? Something like child theme does

Post count: 21065

Hello @gorthi !

Unfortunately, no.
If you have some custom modifications in the theme files, then better save the code and replace it after every update.

Thank you!

Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic.