Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter antoniorigo

    (@antoniorigo)

    Thanks, you’ve been a great help.

    I finally managed to make this work with WordPress Social Login and some custom code based on your plugin:

    if (isset($_POST['subscribe'])) {
        $blog_id = get_current_blog_id();
        $user_ID = get_current_user_id();
        $role = 'subscriber';
        add_user_to_blog($blog_id, $user_ID, $role);
    }
    <form action="?subscribe" method="post">
        <input type="hidden" name="action" value="subscribe">
        <input type="submit" value="Subscribe" name="subscribe" id="subscribe" class="button">
    </form>

    Couldn’t have done it without you!

    Thread Starter antoniorigo

    (@antoniorigo)

    The plugin is activated, and works just fine with the shortcode con a blog post.

    it doesn’t work on a custom_post harcoded.

    Thread Starter antoniorigo

    (@antoniorigo)

    Thanks Mika for this awesome plugin. Very useful functionality!

    Didn’t know about that function, it will come handy, i’m sure.

    The thing is I’d like to expand your button/shortcode functionality, I want to make a single button that does:

    1) If visitor is not registered on the multisite, button shows “Subscribe” text. on click, show modal so the visitor can sign up with facebook, then automatically sign in and add as suscriber of current site. Button text changes to “Subscribed”.

    2) If the visitor is registered on the multisite, but not registered to the current site, button shows “Subscribe” text. on click, user is added as subscriber of the current site. Button text changes to “Subscribed”.

    I have the first use case working as described.

    Now I’m trying to get the second use case going, and I might need to tweak your code so it would work as i need it to.

    So far i’ve tried using the form the shortcode outputs with no success:

    <form action="?jmm-join-site" method="post" id="notmember">
    	<input name="action" value="jmm-join-site" type="hidden">
    	<input value="Join This Site" name="join-site" id="join-site" class="button" type="submit">
    </form>

    Am I missing something?

    Thanks again,
    A

    Thread Starter antoniorigo

    (@antoniorigo)

    Thanks Lester!

    Since I’m using WP_CACHE true I ended up modifing that function instead.

    Tweaked the conditonal in L141 so it wouldn’t skip the home page and added a conditional for L160 that fetches the latest custom-post’s id and adds that to the array.

    All working as wanted 🙂

    Thread Starter antoniorigo

    (@antoniorigo)

    You are correct, It’s a post dispayed in the home page, what I want to know is where in your code could I start looking to make the post counter increment when it’s being viewed on the home page.

    I’m not asking for a solution, just wanted some guidance as to where could I start looking/tweaking to get this functionality going.

    Thread Starter antoniorigo

    (@antoniorigo)

    I understand that, the thing is, I’m displaying the latest (1) post in the home page. and the count is not incrementing.

    Just point me in the right direction so I can solve it. Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)