HI, I need to add some Javascript to the user’s profile page and just this page.
Example: domain.com/members/john, domain.com/members/sandy … so every members page.If I use WordPress’s is_page() function and the slug “members” my JS is also insert in the members directory which I don’t want.
The page is created dynamically, so I dont have any static URL where I can point my code too. Probably I have to insert my code in any of the nouveau template files but which one is the best? The code has to run at the end before the closing body tag.
Whats the best approach to do this?
Hi Josh,
You can usebp_is_user()
to check if you are on user profile page . Also, the recommended hook to inject js would bewp_enqueue_scripts
orbp_enqueue_scripts
.Regards
Brajesh
You must be logged in to reply to this topic.