buddypress activity social share

Hello Guys I am using buddypress and I am sharing activity on social network like facebook and google and I am using url like

 https://www.facebook.com/sharer/sharer.php?t=' . $activity_title . '=' . $activity_link . '

buy when facebook crawls the page it is not logged in so it redirects to home page so instead of sharing the image and title of that activity what shows on the facebook is the image and title of home page.

activity title and link shows correct in the link but when you share it shows the content of home page

Topic social-sharing logging buddypress Wordpress

Category Web


So I have figured it out instead of giving the ids of your activity you have to create a page and pass the id in a get parameter and put a condition in it so that only the facebook or twitter crawler can access it on that page according to the activity id show the content on the og tags.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.