Dynamic action on an icon with link

Hi everyone. I’m trying to make an icon with a link (works like a button), but I need it to change the action depending on whether the user is logged in or not. If the user is logged in, it must take them to their account dashboard, otherwise, it must display a login PopUp (it is already created, with JetPopUp) .

How can i make it work like that?

I’m using Elementor and the Crocoblock plugin suite. Thanks!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer