Get current user id on courses page
-
Hi,
I’d like to use
get_current_user_id()
incontent-course.php
to know what user is connected when looping my courses.But the problem is that the function always returns 0.
I noticed that this is because there is no WordPress header on top of the ‘Courses’ page even when a user is logged in on my website (as it would be the case with any other Learnpress page) :
The function must then consider that no user is logged in at all and return 0.
Is there a way to properly retrieve the current user ID on the courses page? (https://www.clubhouse-tennis.fr/formations/)
– Grégoire
The page I need help with: [log in to see the link]
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Get current user id on courses page’ is closed to new replies.