This is common and I have been googling for hours but found not many helpful answers. How would I get rid of the sign up button after user has been logged in? can we modify or chanage things outside of the php block of code?
2 Answers
Just add another php code block around the button, and render the button conditionally. That would then execute on the server, which is likely the best.
Alternatively, client-side code can be written to achieve the same (javascript), but it would likely be more complex for you (it would potentially involve an ajax request and some js code, depending on how you deliver the rest of the page.content.

ifstatement around the code that displays the sign up button.register.phpscript?