Pop ups on a specific page

Hi, all.

I have some script that generates a pop when a user visits my community.

I know that it works by entering this scripts into the </head>, however, I don’t want it to appear on whichever page the user visits.

Essentially, I need to know, is there some script that I can add either before or after the pop-up script that will make the pop-up only visible on a certain page? For example, a specific topic?

If so, can someone please help?

Thanks

Sure.

Edit your theme with /admin/customize/themes
Add your script like this:

    <script type="text/javascript">
        if(window.location.href === "https://your-forum.com/t/the-topic-target/12345") 
        {
           ... your script here ...
        }
    </script>

I use it, works like a charm :rocket:

3 Likes

Thanks for this!

Just a quick query, am I adding this to the Common CSS or in the head?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.