Support

Home Forums Event Espresso Premium Display different Question Groups based on logged-in status?

Display different Question Groups based on logged-in status?

Posted: June 28, 2013 at 12:49 am


SBANE Webmaster

June 28, 2013 at 12:49 am

WP 3.1, EE 3.1.33.3.P (recently upgraded from 3.019), Personal License

Our client would like to display one set of Question Groups to users who are logged in (aka ‘members’), and a different set to users who are not logged in (‘non-members’). Is this possible?


Dean

June 28, 2013 at 3:04 am

Hi,

I am assuming you do not have member only events? If you did you could just only add the member only question groups to those events.

Otherwise the only method I can think of is to manually edit the registration_page_display.php file and add something like this

<?php
    if(!is_user_logged_in() ) {
?>
    <style>
    #members-only-1372409782 {display:none; }
    </style>
<?php
 }
?>

What this does is checks to see if the user is logged in or not, if not it will display CSS to hide a specific question group (in this case the question group has an ID of members-only-1372409782).

The downside to this method is that if you add a new question group you will need to tweak this code.

Reference – http://codex.wordpress.org/Function_Reference/is_user_logged_in


SBANE Webmaster

June 28, 2013 at 3:40 am

Hi Dean,

Thanks for the rapid response 😉

You’re correct in the assumption that this scenario is for events that are open to members and non-members. So the solution of editing the template will have to do.

Thanks again!


Dean

June 28, 2013 at 4:35 am

No problem!

The support post ‘Display different Question Groups based on logged-in status?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso