I am having trouble implementing the OneAll shortcode in my PHP template file.

edited October 2016 in WordPress

I have what is hopefully a quick question. I have had this kind of issue before, and for the life of me, I can't remember the solution!

I am using the social login plugin from OneAll. I need to place the social login code using a hook in my php template file, so I can build out a modal window on the homepage.

This is the beginnings of my modal:
add_action('genesis_before', 'login_modal');
function login_modal() {
$modal = '
$modal .= do_action('oa_social_login');
$modal .= '
echo $modal;
I am using Genesis. The "genesis_before" action hook adds my code to the front-end within the "gensis_before" area.

My issue is that the "do_action('oa_social_login')" doesn't place the code within my divs, it adds the code outside of my divs, even though structurally it is all hierarchical.

I hope I am explaining this alright.

Basically, instead of my output being < div > LOGIN < / div > ... it's LOGIN< div >< / div >.

I know it's probably a simple fix, but I can't remember what I did before.

Please let me know if I can go into greater detail for you.


Best Answer

  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    edited October 2016 Answer ✓

    do_action does not return a value but displays the buttons right away.
    $modal .= do_action('oa_social_login');

    Could you try this?
    $modal .= oa_social_login_render_login_form ('custom');



Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.