PHP Code to Share Current Post

Hi Themeco.

I created hero by editing the child theme files. I want to add social share buttons too. I want the share buttons to share the current post to social media like Facebook, Twitter etc.

The problem is I don’t want to add the page/post URL manually.

Please help me with the code that would work.

Thanks a lot for your support so far.

Hello @Mrbiizy

Thanks for writing to us.

The feature that you want, it would require custom development I would suggest you consult a developer who can assist you with your concern. Please note that we don’t provide custom development support. It is out of the support scope.

You may check out this thread for reference. Social share buttons on all blog post

Please note that the code provided in above thread serves as a guide only and is to help you in getting started so implementing it and maintaining the code will be out of our support scope and for further maintenance for new possible versions of the theme that may cause the customization to break, you will need to hire a developer.

Thanks for understanding

Okay. Thanks. I know how to use those code. I just need the right one that gets the page permalink automatically.

You are welcome @Mrbiizy

Well, I didn’t get the help I need.

Hey @Mrbiizy,

The solution suggested by my colleague in the other thread works. I just tested it with the exception that I change is_single to is_singular.

Please have a developer check the customizations done on your site. Please note that we do not provide support for custom codes

Thank you for understanding.

Okay, thanks. I already found the solution.

Hi @Mrbiizy,

We’re glad that you’re able to find a solution to your problem. If you have any other questions that are related to our theme functionality, feel free to reach us.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.