skip to Main Content

I am building a website (using WordPress, Neve theme and Elementor Pro) with teaching resources for teachers, under the picture of each resource I want to place a download button with the URL link to download the resource, is it possible to make this download button with the link only accessible to logged-in users using Custom CSS or what would be the easiest way to do this?

2

Answers


  1. In WordPress, you would probably have to use something like this:

    .your-button {
    display: none;
    }
    
    .logged-in .your-button {
    display: block;
    }
    

    Please notice that the button is only visually hidden and could still be accessed via the dev tools.

    Login or Signup to reply.
  2. It’s not safe to use CSS, or anything on the frontend to hide the download button if it’s important that for example students cannot get at the resources/answers.

    In the backend you can add this where you are creating the button:

        if ( is_user_logged_in() ) {
            ... the code outputting the download button and info ...
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search