WordPress.org

Forums

Janrain Social Login
[resolved] Insert Janrain Engage into WordPress Theme? (4 posts)

  1. Tevya
    Member
    Posted 3 years ago #

    I noticed there is shortcodes for inserting the social login into a page or post. Is there a way I can insert a small amount of PHP code into my theme to do the same thing? Inserting in a page/post is nice, but then you have to do it on every, single page/post if you want it to show on each one. However, putting it in the theme file, makes show up on all pages/posts automatically. That's what I want to do: allow people to login at the bottom of each page or post, as part of a custom message I display to all non-logged-in users. I assume the widget just uses some PHP, is there a way to get that php to insert elsewhere in the theme? Or even whatever code the shortcode activates when recognized by the plugin.

    http://wordpress.org/extend/plugins/rpx/

  2. Ryan
    Member
    Posted 3 years ago #

    <?php do_shortcode('[enter-shortcode-here]'); ?>
    Might work. Just add that to your theme template.

  3. Tevya
    Member
    Posted 3 years ago #

    I actually just did "view source" on the login page and extracted the HTML on the Janrain Engage section, then pasted it into my theme file and it works great.

    But I had no idea you could put shortcodes into the PHP! That's awesome, thanks for telling me.

  4. Ryan
    Member
    Posted 3 years ago #

    Oops, made a mistake in that code. It should be:

    <?php echo do_shortcode('[rpxlogin redirect="http://www.janrain.com" prompt="Authenticate!" style="large"]'); ?>

    using the example rpxlogin shortcode.

    And I can confirm that it does in fact work.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags