最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - Popup Cookie Wordpress select language and section (Elementor)

programmeradmin3浏览0评论

I need to show a popup where the user can choose the language and which section to open (partners, customers, support) and that this choice is kept in the cookies so that the next time he returns that section and the selected language are opened directly, but I don't know how to do this, any ideas? (create the popup if I know how to do it but not how to add this selection and save it)

  1. Add Language switch in the popup (modal).
  2. Whatever language selection user made should be stored in Cookie and next time he/she opens, site should open in that specific language saved in it.

I need to show a popup where the user can choose the language and which section to open (partners, customers, support) and that this choice is kept in the cookies so that the next time he returns that section and the selected language are opened directly, but I don't know how to do this, any ideas? (create the popup if I know how to do it but not how to add this selection and save it)

  1. Add Language switch in the popup (modal).
  2. Whatever language selection user made should be stored in Cookie and next time he/she opens, site should open in that specific language saved in it.
Share Improve this question edited Dec 4, 2019 at 12:12 Despotars asked Dec 4, 2019 at 8:12 DespotarsDespotars 1214 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

First of all you need to create a modal pop up with these parameters. after that you can use cookie js.

<script type="text/javascript" src="https://cdn.jsdelivr/npm/[email protected]/src/js.cookie.min.js"></script>

Remember that you need to include jquery before loading this js. For further details you can refer to https://github/js-cookie/js-cookie

After including above js and Jquery in your code. You can directly use Cookies.set('foo', 'bar') to set a cookie with name foo and can access it by Cookies.get('foo')

Now it depends on you how you use it in your program.

发布评论

评论列表(0)

  1. 暂无评论