Thread Starter
scodal
(@scodal)
I apologize, I see the solution here:
https://wordpress.org/support/topic/add-follow-button-on-regular-page-singlephp-not-showing?replies=3
However, I see this is a plain text page refreshing method. How would one make it function slick like the button found on the members loop?
Also, what is a leader_id? I see that a lot in the source, but am unsure what a leader is considered
Plugin Author
r-a-y
(@r-a-y)
How would one make it function slick like the button found on the members loop?
You are referring to AJAX. For custom buttons, you need to add in the AJAX JS function call manually.
Something like the advice in this support thread:
https://wordpress.org/support/topic/ajax-doesnt-respect-link-class-param?replies=3#post-6018349
Also, what is a leader_id?
A leader is the person you want to follow.
A follower is the person that wants to follow the leader.
Thread Starter
scodal
(@scodal)
Nice, thanks for explaining leader/follower. That makes sense now.
Also, I read that and played with it for some time and realized it’s above my head at this point in time.
In the example you gave,
jq('#WHATEVER_YOUR_SELECTOR_IS').on("click", ".follow-button a", function() {
bp_follow_button_action( jq(this) );
return false;
});
How do I determine what to change WHATEVER_YOUR_SELECTOR_IS? Can you give an example of how to use this?
Plugin Author
r-a-y
(@r-a-y)
How do I determine what to change WHATEVER_YOUR_SELECTOR_IS?
The selector should be the parent container that has the follow button.
So let’s say my HTML markup looks like this:
<div id="my-container">
<div id="follow-button" class="generic-button follow-button"><a class="follow" href="XXX">Follow</a></div>
</div>
The selector would be #my-container
.
If you need more help on selectors, I would suggest reading jQuery’s documentation on selectors.