Please or Register to create posts and topics.

Add social networks sharing

Hello,

Thanks a lot for all you did for this wonderful plugin forum.

I want to know if it's possible to add in each forum subject a button to share this subject through social networks instantly ?

Regards

Hello @hbodj

If you use an extension for social-media-sharing and it has an API, you can use the following hook to add your custom code to the bottom of a topic:

function my_share_buttons() {
  // Your share code ...
}
add_action('asgarosforum_topic_custom_content_bottom', 'my_share_buttons');

You can put this snippet in your themes functions.php file.

hbodj has reacted to this post.
hbodj
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Hello,

Thanks for your reply.
I don't know how to add it. Could you help me to add it ?

Regards

Here you are the access of my website:

 

http://geo-canal.info/wp-admin/
user: *removed*
Pass: *removed*

Hello @hbodj

You can edit the functions.php file of your theme in Appearance -> Editor.

Dont forget to adjust the example-code so that it includes your logic for social-sharing.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Hello,
I did but nothing appear on the forum.
Can you help me ?

 

Regards

How does your code-implementation for social-sharing looks like? Maybe there is an error inside.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Hello,
I inserted it as explained but unfortunately it did not work. Can you help me ?
thanks

Can you copy and paste the exact code here? Not only the code I gave you, also the code which you have added to show your social-buttons.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Hello,
I just copy and paste this code on my function.php on the theme:

  1. function my_share_buttons() {
  2. // Your share code ...
  3. }
  4. add_action('asgarosforum_topic_custom_content_bottom', 'my_share_buttons');