I want to make a plugin to only show the answer to those who are logged in.
I know there is a feature in q2a core but that completely hides the question page and prompts the user to log in. But I want to show all but in place of answer div I want to add a custom div with a message and a button with the text "Login to see the answer" and when the user clicks on it it will redirect to the login page.
--> I also want this functionality to work only if a user is viewing the site page on mobile.
Please, anyone, help me how can I achieve this!!