I was able to duplicate the functional popup (coding is hell for me). The problem is that every time you click on the page. What's annoying. Is there a possibility for me as a beginner, so that I can only open the window once for the site? It's for a wordpress page. The code I inserted into the body. Well thank you Here is the code I wrote
<javascript:void(0);" onClick="window.open('<?php echo "https://prehrajto.cz/hledej/" . $post->post_title ."?cc=uga3bwln" ?>','prehrajto','resizable=yes,scrollbars=yes,');">
I try this code , its open once per session , but its blocked browser . It would not mind, it's not the onclick function.
<script type="text/javascript">
onClick=window.open('<?php echo "https://prehrajto.cz/hledej/".get_the_title()."?cc=uga3bwln" ?>','prehrajto','resizable=yes,scrollbars=yes,');
</script>
And my programming experience is zero. I have a problem to combine code and to work with cookies . Im lost .
you can do with partial javascript partial php,
1) Php Based Cookie - Session session check
2) Javascript : Cookie - LocalStorage based session check
yes, you can do that using cookies .
php has functions for dealing with cookies , mainly setcookie() and companions
now, of course these are the most basic general examples, but you could use it with any set of conditions, ( like @Bibberty comment/question ) for example by session, by user, by day, by page, etc . whatever you want .
Sidenote - wp has dedicated functions for using cookies, mainly for auth and session management ( which wp does not do by default ). see wp_set_auth_cookie() to learn more
sidenote 2 Also, regarding your code ... embading php inside JS ( or viceversa...) is a bad practice. wp has actually a very cool and elegant function to deal with that, and if you really want to learn php/wp - you better start using it now
Its done , I did a popup with a css class with a z-index, and I inserted a transparent image as a external link with _blank and onclick into body. Maybe unprofessional but functional