Hi,
If you put
echo do_shortcode('[events_list category="8"]') ;
outside of the if statements does it work?
i tried it but it doesn’t work!
how about just
echo do_shortcode('[events_list]') ;
if not, then make sure you’re adding your code to the right place
i first tried this, to prove that the combination of the if statements work, and it does!
if ( user_role_check( 'd1' )):
echo 'd1' ;
elseif ( user_role_check( 'd2' )):
echo 'd2';
elseif ( user_role_check( 'h1' )):
echo 'h1';
elseif ( user_role_check( 'h2' )):
echo 'h2';
elseif ( user_role_check( 'admin' )):
echo 'admin;
endif;
now i tried it Marcus’ way and changed it to:
if ( user_role_check( 'd1' )):
echo 'd1' ;
elseif ( user_role_check( 'd2' )):
echo 'd2';
elseif ( user_role_check( 'h1' )):
echo 'h1';
elseif ( user_role_check( 'h2' )):
echo 'h2';
elseif ( user_role_check( 'admin' )):
echo do_shortcode('[events_list]');
endif;
and it doesn’t work. i just changed the admin position as i’m working as an admin and to minimize the potential error sources. i think the code is also positioned the right way.
any other ideas?
cheers
try
echo EM_Events::output();
that should definitely work… otherwise something else is going wrong
yes, it does work. but it doesn’t fulfill the need of showing a seperate category of events.
sorry, can you give us more details about this? eg. do you want it to group per category
i want to show a group of events that belongs to a certain event-category. for example users with role “h1” should only see events from category 8 and users with role “d2” should only see events from category 7 and so on.
so i need the code to only show events from a certain category.
hope that’s the information you need.
Hiya,
If you take a look at the output() function in the EM_Events class you will see a number of options you can provide as parameters, including specifying a category.
Thanks,
Phil
oh yeah!
this is how it works, thank you phil! instead of
echo do_shortcode('[events_list category="8"]') ;
i used
echo EM_Events::output( array('category'=>8)) ;
cheers